@othree.io/excuses
Version:
Excuses
22 lines • 855 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnauthorizedError = void 0;
/**
* Custom Error class representing an unauthorized access error.
*/
class UnauthorizedError extends Error {
/**
* Creates a new UnauthorizedError.
*/
constructor() {
super('Unauthorized');
// https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain
this.name = UnauthorizedError.ERROR;
this.stack = new Error().stack;
}
}
exports.UnauthorizedError = UnauthorizedError;
/** Static error code to identify the error type. */
UnauthorizedError.ERROR = 'UnauthorizedError';
//# sourceMappingURL=unauthorized-error.js.map