UNPKG

@belgattitude/http-exception

Version:

Warning: has been moved to @httpx/exception. Please update.

86 lines (83 loc) 4.09 kB
import { HttpBadRequest } from '../client/HttpBadRequest.js'; import { HttpUnauthorized } from '../client/HttpUnauthorized.js'; import { HttpPaymentRequired } from '../client/HttpPaymentRequired.js'; import { HttpForbidden } from '../client/HttpForbidden.js'; import { HttpNotFound } from '../client/HttpNotFound.js'; import { HttpMethodNotAllowed } from '../client/HttpMethodNotAllowed.js'; import { HttpNotAcceptable } from '../client/HttpNotAcceptable.js'; import { HttpProxyAuthenticationRequired } from '../client/HttpProxyAuthenticationRequired.js'; import { HttpRequestTimeout } from '../client/HttpRequestTimeout.js'; import { HttpConflict } from '../client/HttpConflict.js'; import { HttpGone } from '../client/HttpGone.js'; import { HttpLengthRequired } from '../client/HttpLengthRequired.js'; import { HttpPreconditionFailed } from '../client/HttpPreconditionFailed.js'; import { HttpPayloadTooLarge } from '../client/HttpPayloadTooLarge.js'; import { HttpUriTooLong } from '../client/HttpUriTooLong.js'; import { HttpUnsupportedMediaType } from '../client/HttpUnsupportedMediaType.js'; import { HttpRangeNotSatisfiable } from '../client/HttpRangeNotSatisfiable.js'; import { HttpExpectationFailed } from '../client/HttpExpectationFailed.js'; import { HttpImATeapot } from '../client/HttpImATeapot.js'; import { HttpMisdirectedRequest } from '../client/HttpMisdirectedRequest.js'; import { HttpUnprocessableEntity } from '../client/HttpUnprocessableEntity.js'; import { HttpLocked } from '../client/HttpLocked.js'; import { HttpFailedDependency } from '../client/HttpFailedDependency.js'; import { HttpTooEarly } from '../client/HttpTooEarly.js'; import { HttpUpgradeRequired } from '../client/HttpUpgradeRequired.js'; import { HttpPreconditionRequired } from '../client/HttpPreconditionRequired.js'; import { HttpTooManyRequests } from '../client/HttpTooManyRequests.js'; import { HttpRequestHeaderFieldsTooLarge } from '../client/HttpRequestHeaderFieldsTooLarge.js'; import { HttpUnavailableForLegalReasons } from '../client/HttpUnavailableForLegalReasons.js'; import { HttpInternalServerError } from '../server/HttpInternalServerError.js'; import { HttpNotImplemented } from '../server/HttpNotImplemented.js'; import { HttpBadGateway } from '../server/HttpBadGateway.js'; import { HttpServiceUnavailable } from '../server/HttpServiceUnavailable.js'; import { HttpGatewayTimeout } from '../server/HttpGatewayTimeout.js'; import { HttpVersionNotSupported } from '../server/HttpVersionNotSupported.js'; import { HttpVariantAlsoNegotiates } from '../server/HttpVariantAlsoNegotiates.js'; import { HttpInsufficientStorage } from '../server/HttpInsufficientStorage.js'; import { HttpLoopDetected } from '../server/HttpLoopDetected.js'; import { HttpNotExtended } from '../server/HttpNotExtended.js'; import { HttpNetworkAuthenticationRequired } from '../server/HttpNetworkAuthenticationRequired.js'; var statusMap = { 400: HttpBadRequest, 401: HttpUnauthorized, 402: HttpPaymentRequired, 403: HttpForbidden, 404: HttpNotFound, 405: HttpMethodNotAllowed, 406: HttpNotAcceptable, 407: HttpProxyAuthenticationRequired, 408: HttpRequestTimeout, 409: HttpConflict, 410: HttpGone, 411: HttpLengthRequired, 412: HttpPreconditionFailed, 413: HttpPayloadTooLarge, 414: HttpUriTooLong, 415: HttpUnsupportedMediaType, 416: HttpRangeNotSatisfiable, 417: HttpExpectationFailed, 418: HttpImATeapot, 421: HttpMisdirectedRequest, 422: HttpUnprocessableEntity, 423: HttpLocked, 424: HttpFailedDependency, 425: HttpTooEarly, 426: HttpUpgradeRequired, 428: HttpPreconditionRequired, 429: HttpTooManyRequests, 431: HttpRequestHeaderFieldsTooLarge, 451: HttpUnavailableForLegalReasons, 500: HttpInternalServerError, 501: HttpNotImplemented, 502: HttpBadGateway, 503: HttpServiceUnavailable, 504: HttpGatewayTimeout, 505: HttpVersionNotSupported, 506: HttpVariantAlsoNegotiates, 507: HttpInsufficientStorage, 508: HttpLoopDetected, 510: HttpNotExtended, 511: HttpNetworkAuthenticationRequired }; export { statusMap };