UNPKG

trapx

Version:

A plug-and-play middleware for standardized error handling in TypeScript-based Express.js applications

15 lines (14 loc) 448 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnauthorizedError = void 0; const BaseError_1 = require("./BaseError"); class UnauthorizedError extends BaseError_1.BaseError { constructor(message, metadata = {}) { super({ message, statusCode: 401, metadata: { ...metadata, code: 'UNAUTHORIZED' } }); } } exports.UnauthorizedError = UnauthorizedError;