mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
15 lines
409 B
JavaScript
15 lines
409 B
JavaScript
|
// # Not found error
|
||
|
// Custom error class with status code and type prefilled.
|
||
|
|
||
|
function MethodNotAllowedError(message) {
|
||
|
this.message = message;
|
||
|
this.stack = new Error().stack;
|
||
|
this.code = 405;
|
||
|
this.type = this.name;
|
||
|
}
|
||
|
|
||
|
MethodNotAllowedError.prototype = Object.create(Error.prototype);
|
||
|
MethodNotAllowedError.prototype.name = 'MethodNotAllowedError';
|
||
|
|
||
|
module.exports = MethodNotAllowedError;
|