mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
fdcb67d3cc
closes #5178 - renamed error.type to error.errorType
15 lines
386 B
JavaScript
15 lines
386 B
JavaScript
// # Bad request error
|
|
// Custom error class with status code and type prefilled.
|
|
|
|
function BadRequestError(message) {
|
|
this.message = message;
|
|
this.stack = new Error().stack;
|
|
this.code = 400;
|
|
this.errorType = this.name;
|
|
}
|
|
|
|
BadRequestError.prototype = Object.create(Error.prototype);
|
|
BadRequestError.prototype.name = 'BadRequestError';
|
|
|
|
module.exports = BadRequestError;
|