0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/errors/theme-validation-error.js

19 lines
494 B
JavaScript
Raw Normal View History

// # 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;