@beenotung/tslib
Version:
utils library in Typescript
27 lines (26 loc) • 672 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotImplError = exports.HttpError = void 0;
exports.not_impl = not_impl;
class HttpError extends Error {
status;
statusCode;
constructor(statusCode, message) {
super(message);
this.statusCode = statusCode;
this.status = statusCode;
}
toString() {
return `HttpError(${this.status}): ${this.message}`;
}
}
exports.HttpError = HttpError;
class NotImplError extends HttpError {
constructor() {
super(501, 'Not Implemented');
}
}
exports.NotImplError = NotImplError;
function not_impl() {
throw new NotImplError();
}