1
0
mirror of https://github.com/TryGhost/Ghost.git synced 2024-12-15 11:34:24 +03:00
Ghost/core/server/errors/too-many-requests-error.js

15 lines
423 B
JavaScript
Raw Normal View History

// # Too Many Requests Error
// Custom error class with status code and type prefilled.
function TooManyRequestsError(message) {
this.message = message;
this.stack = new Error().stack;
this.statusCode = 429;
this.errorType = this.name;
}
TooManyRequestsError.prototype = Object.create(Error.prototype);
TooManyRequestsError.prototype.name = 'TooManyRequestsError';
module.exports = TooManyRequestsError;