UNPKG

@beenotung/tslib

Version:
27 lines (26 loc) 672 B
"use strict"; 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(); }