@mdf.js/crash
Version:
MMS - API Crash - Enhanced error management library
71 lines • 3.96 kB
JavaScript
;
/**
* Copyright 2024 Mytra Control S.L. All rights reserved.
*
* Use of this source code is governed by an MIT-style license that can be found in the LICENSE file
* or at https://opensource.org/licenses/MIT.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.HTTP_CODES = exports.CONFIG_MAX_ERROR_MESSAGE_LENGTH = void 0;
const types_1 = require("../types");
exports.CONFIG_MAX_ERROR_MESSAGE_LENGTH = 800;
exports.HTTP_CODES = new Map([
[types_1.HTTPCode.CONTINUE, 'Continue'],
[types_1.HTTPCode.SWITCHING_PROTOCOLS, 'Switching Protocols'],
[types_1.HTTPCode.PROCESSING, 'Processing'],
[types_1.HTTPCode.OK, 'OK'],
[types_1.HTTPCode.CREATED, 'Created'],
[types_1.HTTPCode.ACCEPTED, 'Accepted'],
[types_1.HTTPCode.NON_AUTHORITATIVE_INFORMATION, 'Non-Authoritative Information'],
[types_1.HTTPCode.NO_CONTENT, 'No Content'],
[types_1.HTTPCode.RESET_CONTENT, 'Reset Content'],
[types_1.HTTPCode.PARTIAL_CONTENT, 'Partial Content'],
[types_1.HTTPCode.MULTI_STATUS, 'Multi-Status'],
[types_1.HTTPCode.MULTIPLE_CHOICES, 'Multiple Choices'],
[types_1.HTTPCode.MOVED_PERMANENTLY, 'Moved Permanently'],
[types_1.HTTPCode.FOUND, 'Found'],
[types_1.HTTPCode.SEE_OTHER, 'See Other'],
[types_1.HTTPCode.NOT_MODIFIED, 'Not Modified'],
[types_1.HTTPCode.USE_PROXY, 'Use Proxy'],
[types_1.HTTPCode.TEMPORARY_REDIRECT, 'Temporary Redirect'],
[types_1.HTTPCode.BAD_REQUEST, 'Bad Request'],
[types_1.HTTPCode.UNAUTHORIZED, 'Unauthorized'],
[types_1.HTTPCode.PAYMENT_REQUIRED, 'Payment Required'],
[types_1.HTTPCode.FORBIDDEN, 'Forbidden'],
[types_1.HTTPCode.NOT_FOUND, 'Not Found'],
[types_1.HTTPCode.METHOD_NOT_ALLOWED, 'Method Not Allowed'],
[types_1.HTTPCode.NOT_ACCEPTABLE, 'Not Acceptable'],
[types_1.HTTPCode.PROXY_AUTHENTICATION_REQUIRED, 'Proxy Authentication Required'],
[types_1.HTTPCode.REQUEST_TIMEOUT, 'Request Time-out'],
[types_1.HTTPCode.CONFLICT, 'Conflict'],
[types_1.HTTPCode.GONE, 'Gone'],
[types_1.HTTPCode.LENGTH_REQUIRED, 'Length Required'],
[types_1.HTTPCode.PRECONDITION_FAILED, 'Precondition Failed'],
[types_1.HTTPCode.PAYLOAD_TOO_LARGE, 'Request Entity Too Large'],
[types_1.HTTPCode.URI_TOO_LONG, 'Request-URI Too Large'],
[types_1.HTTPCode.UNSUPPORTED_MEDIA_TYPE, 'Unsupported Media Type'],
[types_1.HTTPCode.RANGE_NOT_SATISFIABLE, 'Requested Range Not Satisfiable'],
[types_1.HTTPCode.EXPECTATION_FAILED, 'Expectation Failed'],
[types_1.HTTPCode.I_AM_A_TEAPOT, "I'm a teapot"],
[types_1.HTTPCode.UNPROCESSABLE_ENTITY, 'Unprocessable Entity'],
[types_1.HTTPCode.LOCKED, 'Locked'],
[types_1.HTTPCode.FAILED_DEPENDENCY, 'Failed Dependency'],
[types_1.HTTPCode.TOO_EARLY, 'Too Early'],
[types_1.HTTPCode.UPGRADE_REQUIRED, 'Upgrade Required'],
[types_1.HTTPCode.PRECONDITION_REQUIRED, 'Precondition Required'],
[types_1.HTTPCode.TOO_MANY_REQUESTS, 'Too Many Requests'],
[types_1.HTTPCode.REQUEST_HEADER_FIELDS_TOO_LARGE, 'Request Header Fields Too Large'],
[types_1.HTTPCode.UNAVAILABLE_FOR_LEGAL_REASONS, 'Unavailable For Legal Reasons'],
[types_1.HTTPCode.INTERNAL_SERVER_ERROR, 'Internal Server Error'],
[types_1.HTTPCode.NOT_IMPLEMENTED, 'Not Implemented'],
[types_1.HTTPCode.BAD_GATEWAY, 'Bad Gateway'],
[types_1.HTTPCode.SERVICE_UNAVAILABLE, 'Service Unavailable'],
[types_1.HTTPCode.GATEWAY_TIMEOUT, 'Gateway Time-out'],
[types_1.HTTPCode.HTTP_VERSION_NOT_SUPPORTED, 'HTTP Version Not Supported'],
[types_1.HTTPCode.VARIANT_ALSO_NEGOTIATES, 'Variant Also Negotiates'],
[types_1.HTTPCode.INSUFFICIENT_STORAGE, 'Insufficient Storage'],
[types_1.HTTPCode.BANDWIDTH_LIMIT_EXCEEDED, 'Bandwidth Limit Exceeded'],
[types_1.HTTPCode.NOT_EXTENDED, 'Not Extended'],
[types_1.HTTPCode.NETWORK_AUTHENTICATION_REQUIRED, 'Network Authentication Required'],
]);
//# sourceMappingURL=index.js.map