Initial commit

This commit is contained in:
Brik
2026-01-27 04:16:08 +01:00
commit c296f53ba1
20 changed files with 3212 additions and 0 deletions

21
errors/DefaultError.js Normal file
View File

@@ -0,0 +1,21 @@
class DefaultError extends Error {
constructor(code, message, cause, name) {
super(message)
this.code = code || 500
this.name = name || "DefaultError"
this.cause = cause || "Internal Server Error"
this.message = message || "Internal Server Error"
this.isOperational = true
Error.captureStackTrace(this, this.constructor)
}
serialize() {
return {
code: this.code,
message: this.message
}
}
}
module.exports = DefaultError

3
errors/errors.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
DefaultError: require("./DefaultError")
}