frontend/.pnpm-store/v3/files/7f/6680ff54fb60ded5b56b767a3d33c8a9374fdb2e9b84f0afc3ce0a0429bb4a1193d84cdd002c122fb276efd2cc0db6112d2ddfa7de005417e6550c31ce74b7

18 lines
591 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const http_1 = require("http");
/**
* Error subclass to use when an HTTP application error has occurred.
*/
class HTTPError extends Error {
constructor(statusCode, message = http_1.STATUS_CODES[statusCode]) {
super(message);
Object.setPrototypeOf(this, new.target.prototype);
this.statusCode = statusCode;
this.code = `E${String(message)
.toUpperCase()
.replace(/\s+/g, '')}`;
}
}
exports.default = HTTPError;
//# sourceMappingURL=http-error.js.map