Base-REST-API/errors/DefaultError.js
Azure 7e1eaf3f1f Add dynamic route matching and validation improvements
Introduces dynamic route parameter support in route path computation and schema matching. Adds a utility for sending validation errors, updates schema definitions to support header validation, and refactors server middleware to handle header, body, and query validation with improved error handling. Also adds a placeholder user route and updates dependencies to include 'path-to-regexp'.
2025-12-20 18:19:03 +01:00

21 lines
528 B
JavaScript

class DefaultError extends Error {
constructor(code, message, cause, name) {
super(message)
this.code = code
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