UNPKG

rfc9457

Version:

RFC 9457 Problem Details for HTTP APIs - A standardized error handling package for Node.js

15 lines 613 B
import { HttpError } from "../../core/index.js"; import { extractCause, getErrorType, normalizeToString, } from "../../helpers/index.js"; export class UnavailableForLegalReasonsError extends HttpError { constructor(detail) { super({ type: getErrorType("unavailable-for-legal-reasons"), title: "Unavailable For Legal Reasons", status: 451, detail: normalizeToString(detail), cause: extractCause(detail), }); this.name = "UnavailableForLegalReasonsError"; } } //# sourceMappingURL=unavailable-for-legal-reasons-error.js.map