mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
19 lines
494 B
JavaScript
19 lines
494 B
JavaScript
|
// # Theme Validation Error
|
||
|
// Custom error class with status code and type prefilled.
|
||
|
|
||
|
function ThemeValidationError(message, details) {
|
||
|
this.message = message;
|
||
|
this.stack = new Error().stack;
|
||
|
this.statusCode = 422;
|
||
|
if (details) {
|
||
|
this.errorDetails = details;
|
||
|
}
|
||
|
|
||
|
this.errorType = this.name;
|
||
|
}
|
||
|
|
||
|
ThemeValidationError.prototype = Object.create(Error.prototype);
|
||
|
ThemeValidationError.prototype.name = 'ThemeValidationError';
|
||
|
|
||
|
module.exports = ThemeValidationError;
|