@rafat97/exceptionhandler
Version:
All types exception handler classes definition
25 lines • 928 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MethodNotAllowedException = void 0;
const CustomError_1 = require("./CustomError");
/*
405 Method Not Allowed
The request method is known by the server but is not supported by the target resource.
For example, an API may not allow calling DELETE to remove a resource.
*/
class MethodNotAllowedException extends CustomError_1.CustomError {
constructor(message = "Method Not Allowed") {
super(message);
this.message = message;
this.statusCode = 405;
Object.setPrototypeOf(this, MethodNotAllowedException.prototype);
}
getStatusCode() {
return this.statusCode;
}
serializeErrors() {
return { message: this.message, details: [] };
}
}
exports.MethodNotAllowedException = MethodNotAllowedException;
//# sourceMappingURL=MethodNotAllowedException.js.map