| Server IP : 159.203.156.69 / Your IP : 216.73.216.37 Web Server : nginx/1.24.0 System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/tanviranik.com/node_modules/@poppinss/exception/build/ |
Upload File : |
import { format } from "node:util";
var Exception = class extends Error {
name;
status;
constructor(message, options) {
super(message, options);
const ErrorConstructor = this.constructor;
this.name = ErrorConstructor.name;
this.message = message || ErrorConstructor.message || "";
this.status = options?.status || ErrorConstructor.status || 500;
const code = options?.code || ErrorConstructor.code;
if (code !== void 0) this.code = code;
const help = ErrorConstructor.help;
if (help !== void 0) this.help = help;
Error.captureStackTrace(this, ErrorConstructor);
}
get [Symbol.toStringTag]() {
return this.constructor.name;
}
toString() {
if (this.code) return `${this.name} [${this.code}]: ${this.message}`;
return `${this.name}: ${this.message}`;
}
};
var InvalidArgumentsException = class extends Exception {
static code = "E_INVALID_ARGUMENTS_EXCEPTION";
static status = 500;
};
var RuntimeException = class extends Exception {
static code = "E_RUNTIME_EXCEPTION";
static status = 500;
};
function createError(message, code, status) {
return class extends Exception {
static message = message;
static code = code;
static status = status;
constructor(args, options) {
super(format(message, ...args || []), options);
this.name = "Exception";
}
};
}
export { Exception, InvalidArgumentsException, RuntimeException, createError };