@voiceflow/exception 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/base-error.interface.d.ts +1 -0
- package/build/cjs/base-error.interface.d.ts.map +1 -0
- package/build/cjs/base-error.interface.js +0 -1
- package/build/cjs/base-response.interface.d.ts +1 -0
- package/build/cjs/base-response.interface.d.ts.map +1 -0
- package/build/cjs/base-response.interface.js +0 -1
- package/build/cjs/client.exception.d.ts +1 -0
- package/build/cjs/client.exception.d.ts.map +1 -0
- package/build/cjs/client.exception.js +1 -2
- package/build/cjs/error-code.enum.d.ts +1 -0
- package/build/cjs/error-code.enum.d.ts.map +1 -0
- package/build/cjs/error-code.enum.js +0 -1
- package/build/cjs/error-message.interface.d.ts +1 -0
- package/build/cjs/error-message.interface.d.ts.map +1 -0
- package/build/cjs/error-message.interface.js +0 -1
- package/build/cjs/error-payload.interface.d.ts +1 -0
- package/build/cjs/error-payload.interface.d.ts.map +1 -0
- package/build/cjs/error-payload.interface.js +0 -1
- package/build/cjs/http/http-4xx.exception.d.ts +1 -0
- package/build/cjs/http/http-4xx.exception.d.ts.map +1 -0
- package/build/cjs/http/http-4xx.exception.js +0 -1
- package/build/cjs/http/http-5xx.exception.d.ts +1 -0
- package/build/cjs/http/http-5xx.exception.d.ts.map +1 -0
- package/build/cjs/http/http-5xx.exception.js +0 -1
- package/build/cjs/http/http-status.enum.d.ts +1 -0
- package/build/cjs/http/http-status.enum.d.ts.map +1 -0
- package/build/cjs/http/http-status.enum.js +0 -1
- package/build/cjs/http/http.exception.d.ts +4 -3
- package/build/cjs/http/http.exception.d.ts.map +1 -0
- package/build/cjs/http/http.exception.js +9 -3
- package/build/cjs/http/utils.d.ts +2 -1
- package/build/cjs/http/utils.d.ts.map +1 -0
- package/build/cjs/http/utils.js +0 -1
- package/build/cjs/internal.exception.d.ts +1 -0
- package/build/cjs/internal.exception.d.ts.map +1 -0
- package/build/cjs/internal.exception.js +0 -1
- package/build/cjs/main.d.ts +1 -0
- package/build/cjs/main.d.ts.map +1 -0
- package/build/cjs/main.js +0 -1
- package/build/cjs/package.json +1 -0
- package/build/esm/base-error.interface.d.ts +2 -1
- package/build/esm/base-error.interface.d.ts.map +1 -0
- package/build/esm/base-error.interface.js +0 -1
- package/build/esm/base-response.interface.d.ts +1 -0
- package/build/esm/base-response.interface.d.ts.map +1 -0
- package/build/esm/base-response.interface.js +0 -1
- package/build/esm/client.exception.d.ts +4 -3
- package/build/esm/client.exception.d.ts.map +1 -0
- package/build/esm/client.exception.js +1 -2
- package/build/esm/error-code.enum.d.ts +1 -0
- package/build/esm/error-code.enum.d.ts.map +1 -0
- package/build/esm/error-code.enum.js +0 -1
- package/build/esm/error-message.interface.d.ts +2 -1
- package/build/esm/error-message.interface.d.ts.map +1 -0
- package/build/esm/error-message.interface.js +0 -1
- package/build/esm/error-payload.interface.d.ts +2 -1
- package/build/esm/error-payload.interface.d.ts.map +1 -0
- package/build/esm/error-payload.interface.js +0 -1
- package/build/esm/http/http-4xx.exception.d.ts +30 -29
- package/build/esm/http/http-4xx.exception.d.ts.map +1 -0
- package/build/esm/http/http-4xx.exception.js +2 -3
- package/build/esm/http/http-5xx.exception.d.ts +12 -11
- package/build/esm/http/http-5xx.exception.d.ts.map +1 -0
- package/build/esm/http/http-5xx.exception.js +2 -3
- package/build/esm/http/http-status.enum.d.ts +1 -0
- package/build/esm/http/http-status.enum.d.ts.map +1 -0
- package/build/esm/http/http-status.enum.js +0 -1
- package/build/esm/http/http.exception.d.ts +4 -3
- package/build/esm/http/http.exception.d.ts.map +1 -0
- package/build/esm/http/http.exception.js +10 -4
- package/build/esm/http/utils.d.ts +4 -3
- package/build/esm/http/utils.d.ts.map +1 -0
- package/build/esm/http/utils.js +1 -2
- package/build/esm/internal.exception.d.ts +4 -3
- package/build/esm/internal.exception.d.ts.map +1 -0
- package/build/esm/internal.exception.js +1 -2
- package/build/esm/main.d.ts +12 -11
- package/build/esm/main.d.ts.map +1 -0
- package/build/esm/main.js +11 -12
- package/build/esm/package.json +1 -0
- package/package.json +14 -10
- package/build/cjs/base-error.interface.js.map +0 -1
- package/build/cjs/base-response.interface.js.map +0 -1
- package/build/cjs/client.exception.js.map +0 -1
- package/build/cjs/error-code.enum.js.map +0 -1
- package/build/cjs/error-message.interface.js.map +0 -1
- package/build/cjs/error-payload.interface.js.map +0 -1
- package/build/cjs/http/http-4xx.exception.js.map +0 -1
- package/build/cjs/http/http-5xx.exception.js.map +0 -1
- package/build/cjs/http/http-status.enum.js.map +0 -1
- package/build/cjs/http/http.exception.js.map +0 -1
- package/build/cjs/http/utils.js.map +0 -1
- package/build/cjs/internal.exception.js.map +0 -1
- package/build/cjs/main.js.map +0 -1
- package/build/esm/base-error.interface.js.map +0 -1
- package/build/esm/base-response.interface.js.map +0 -1
- package/build/esm/client.exception.js.map +0 -1
- package/build/esm/error-code.enum.js.map +0 -1
- package/build/esm/error-message.interface.js.map +0 -1
- package/build/esm/error-payload.interface.js.map +0 -1
- package/build/esm/http/http-4xx.exception.js.map +0 -1
- package/build/esm/http/http-5xx.exception.js.map +0 -1
- package/build/esm/http/http-status.enum.js.map +0 -1
- package/build/esm/http/http.exception.js.map +0 -1
- package/build/esm/http/utils.js.map +0 -1
- package/build/esm/internal.exception.js.map +0 -1
- package/build/esm/main.js.map +0 -1
- package/build/tsconfig.build.tsbuildinfo +0 -1
- package/build/tsconfig.esm.tsbuildinfo +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-error.interface.d.ts","sourceRoot":"","sources":["../../src/base-error.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-response.interface.d.ts","sourceRoot":"","sources":["../../src/base-response.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.exception.d.ts","sourceRoot":"","sources":["../../src/client.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBAAa,eAAe,CAAC,GAAG,SAAS,YAAY,GAAG,YAAY,CAAE,SAAQ,KAAM,YAAW,YAAY;WAC3F,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,eAAe;IAInD,QAAQ,EAAE,GAAG,CAAC;IAEd,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEb,QAAQ,EAAE,GAAG;IAQzB,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,kBAAkB;IAInB,QAAQ;IAIF,KAAK;IAYX,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,IAAI;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;CAGlE"}
|
|
@@ -32,7 +32,7 @@ class ClientException extends Error {
|
|
|
32
32
|
try {
|
|
33
33
|
this.extractDetailedError(JSON.parse(text));
|
|
34
34
|
}
|
|
35
|
-
catch
|
|
35
|
+
catch {
|
|
36
36
|
this.extractOpaqueError(text);
|
|
37
37
|
}
|
|
38
38
|
return this;
|
|
@@ -42,4 +42,3 @@ class ClientException extends Error {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.ClientException = ClientException;
|
|
45
|
-
//# sourceMappingURL=client.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-code.enum.d.ts","sourceRoot":"","sources":["../../src/error-code.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,+BAA+B,oCAAoC;IACnE,8BAA8B,mCAAmC;IAEjE,sBAAsB,2BAA2B;IACjD,wBAAwB,6BAA6B;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-message.interface.d.ts","sourceRoot":"","sources":["../../src/error-message.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,oBAAY,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-payload.interface.d.ts","sourceRoot":"","sources":["../../src/error-payload.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -27,3 +27,4 @@ export declare const PreconditionRequiredException: import("./utils").HTTPExcept
|
|
|
27
27
|
export declare const TooManyRequestsException: import("./utils").HTTPExceptionClass;
|
|
28
28
|
export declare const RequestHeaderFieldsTooLargeException: import("./utils").HTTPExceptionClass;
|
|
29
29
|
export declare const UnavailableForLegalReasonsException: import("./utils").HTTPExceptionClass;
|
|
30
|
+
//# sourceMappingURL=http-4xx.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-4xx.exception.d.ts","sourceRoot":"","sources":["../../../src/http/http-4xx.exception.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,sCAA6D,CAAC;AAC9F,eAAO,MAAM,qBAAqB,sCAA+D,CAAC;AAClG,eAAO,MAAM,wBAAwB,sCAAuE,CAAC;AAC7G,eAAO,MAAM,kBAAkB,sCAAyD,CAAC;AACzF,eAAO,MAAM,iBAAiB,sCAAyD,CAAC;AACxF,eAAO,MAAM,yBAAyB,sCAA2E,CAAC;AAClH,eAAO,MAAM,sBAAsB,sCAAmE,CAAC;AACvG,eAAO,MAAM,oCAAoC,sCAAiG,CAAC;AACnJ,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,iBAAiB,sCAAuD,CAAC;AACtF,eAAO,MAAM,aAAa,sCAA+C,CAAC;AAC1E,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,2BAA2B,sCAA6E,CAAC;AACtH,eAAO,MAAM,wBAAwB,sCAAyE,CAAC;AAC/G,eAAO,MAAM,mBAAmB,sCAA+D,CAAC;AAChG,eAAO,MAAM,6BAA6B,sCAAmF,CAAC;AAC9H,eAAO,MAAM,4BAA4B,sCAAiF,CAAC;AAC3H,eAAO,MAAM,0BAA0B,sCAA2E,CAAC;AACnH,eAAO,MAAM,kBAAkB,sCAAgE,CAAC;AAChG,eAAO,MAAM,2BAA2B,sCAA6E,CAAC;AACtH,eAAO,MAAM,4BAA4B,sCAA+E,CAAC;AACzH,eAAO,MAAM,eAAe,sCAAmD,CAAC;AAChF,eAAO,MAAM,yBAAyB,sCAAyE,CAAC;AAChH,eAAO,MAAM,iBAAiB,sCAAyD,CAAC;AACxF,eAAO,MAAM,wBAAwB,sCAAuE,CAAC;AAC7G,eAAO,MAAM,6BAA6B,sCAAiF,CAAC;AAC5H,eAAO,MAAM,wBAAwB,sCAAyE,CAAC;AAC/G,eAAO,MAAM,oCAAoC,sCAGhD,CAAC;AACF,eAAO,MAAM,mCAAmC,sCAAiG,CAAC"}
|
|
@@ -32,4 +32,3 @@ exports.PreconditionRequiredException = (0, utils_1.createHTTPException)(http_st
|
|
|
32
32
|
exports.TooManyRequestsException = (0, utils_1.createHTTPException)(http_status_enum_1.HTTPStatus.TOO_MANY_REQUESTS, 'Too Many Requests');
|
|
33
33
|
exports.RequestHeaderFieldsTooLargeException = (0, utils_1.createHTTPException)(http_status_enum_1.HTTPStatus.REQUEST_HEADER_FIELDS_TOO_LARGE, 'Request Header Fields Too Large');
|
|
34
34
|
exports.UnavailableForLegalReasonsException = (0, utils_1.createHTTPException)(http_status_enum_1.HTTPStatus.UNAVAILABLE_FOR_LEGAL_REASONS, 'Unavailable For Legal Reasons');
|
|
35
|
-
//# sourceMappingURL=http-4xx.exception.js.map
|
|
@@ -9,3 +9,4 @@ export declare const InsufficientStorageException: import("./utils").HTTPExcepti
|
|
|
9
9
|
export declare const LoopDetectedException: import("./utils").HTTPExceptionClass;
|
|
10
10
|
export declare const NotExtendedException: import("./utils").HTTPExceptionClass;
|
|
11
11
|
export declare const NetworkAuthenticationRequiredException: import("./utils").HTTPExceptionClass;
|
|
12
|
+
//# sourceMappingURL=http-5xx.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-5xx.exception.d.ts","sourceRoot":"","sources":["../../../src/http/http-5xx.exception.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,sCAAiF,CAAC;AAC3H,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,mBAAmB,sCAA6D,CAAC;AAC9F,eAAO,MAAM,2BAA2B,sCAA6E,CAAC;AACtH,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,gCAAgC,sCAA2F,CAAC;AACzI,eAAO,MAAM,8BAA8B,sCAAqF,CAAC;AACjI,eAAO,MAAM,4BAA4B,sCAA+E,CAAC;AACzH,eAAO,MAAM,qBAAqB,sCAAiE,CAAC;AACpG,eAAO,MAAM,oBAAoB,sCAA+D,CAAC;AACjG,eAAO,MAAM,sCAAsC,sCAGlD,CAAC"}
|
|
@@ -14,4 +14,3 @@ exports.InsufficientStorageException = (0, utils_1.createHTTPException)(http_sta
|
|
|
14
14
|
exports.LoopDetectedException = (0, utils_1.createHTTPException)(http_status_enum_1.HTTPStatus.LOOP_DETECTED, 'Loop Detected');
|
|
15
15
|
exports.NotExtendedException = (0, utils_1.createHTTPException)(http_status_enum_1.HTTPStatus.NOT_EXTENDED, 'Not Extended');
|
|
16
16
|
exports.NetworkAuthenticationRequiredException = (0, utils_1.createHTTPException)(http_status_enum_1.HTTPStatus.NETWORK_AUTHENTICATION_REQUIRED, 'Network Authentication Required');
|
|
17
|
-
//# sourceMappingURL=http-5xx.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status.enum.d.ts","sourceRoot":"","sources":["../../../src/http/http-status.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAEpB,WAAW,MAAM;IACjB,YAAY,MAAM;IAClB,gBAAgB,MAAM;IACtB,SAAS,MAAM;IACf,SAAS,MAAM;IACf,kBAAkB,MAAM;IACxB,cAAc,MAAM;IACpB,6BAA6B,MAAM;IACnC,eAAe,MAAM;IACrB,QAAQ,MAAM;IACd,IAAI,MAAM;IACV,eAAe,MAAM;IACrB,mBAAmB,MAAM;IACzB,iBAAiB,MAAM;IACvB,YAAY,MAAM;IAClB,sBAAsB,MAAM;IAC5B,qBAAqB,MAAM;IAC3B,kBAAkB,MAAM;IACxB,aAAa,MAAM;IACnB,mBAAmB,MAAM;IACzB,oBAAoB,MAAM;IAC1B,MAAM,MAAM;IACZ,iBAAiB,MAAM;IACvB,SAAS,MAAM;IACf,gBAAgB,MAAM;IACtB,qBAAqB,MAAM;IAC3B,iBAAiB,MAAM;IACvB,+BAA+B,MAAM;IACrC,6BAA6B,MAAM;IAGnC,qBAAqB,MAAM;IAC3B,eAAe,MAAM;IACrB,WAAW,MAAM;IACjB,mBAAmB,MAAM;IACzB,eAAe,MAAM;IACrB,0BAA0B,MAAM;IAChC,uBAAuB,MAAM;IAC7B,oBAAoB,MAAM;IAC1B,aAAa,MAAM;IACnB,YAAY,MAAM;IAClB,+BAA+B,MAAM;CACtC"}
|
|
@@ -46,4 +46,3 @@ var HTTPStatus;
|
|
|
46
46
|
HTTPStatus[HTTPStatus["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
|
|
47
47
|
HTTPStatus[HTTPStatus["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
48
48
|
})(HTTPStatus = exports.HTTPStatus || (exports.HTTPStatus = {}));
|
|
49
|
-
//# sourceMappingURL=http-status.enum.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ErrorMessage } from
|
|
2
|
-
import { ErrorPayload } from
|
|
3
|
-
import { InternalException } from
|
|
1
|
+
import { ErrorMessage } from '../error-message.interface';
|
|
2
|
+
import { ErrorPayload } from '../error-payload.interface';
|
|
3
|
+
import { InternalException } from '../internal.exception';
|
|
4
4
|
export interface SerializedHTTPException {
|
|
5
5
|
message: string;
|
|
6
6
|
statusCode: number;
|
|
@@ -16,3 +16,4 @@ export declare class HTTPException extends InternalException implements Serializ
|
|
|
16
16
|
constructor(statusCode: number, statusText: string, msg?: ErrorMessage);
|
|
17
17
|
createResponse(): ErrorPayload;
|
|
18
18
|
}
|
|
19
|
+
//# sourceMappingURL=http.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.exception.d.ts","sourceRoot":"","sources":["../../../src/http/http.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,aAAc,SAAQ,iBAAkB,YAAW,uBAAuB;WACvE,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,aAAa;IAIxD,OAAO,CAAC,MAAM,CAAC,qBAAqB;WAItB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,uBAAuB;IASzE,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,YAAY,CAAC;gBAElB,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,GAAE,YAAyB;IAQ3E,cAAc,IAAI,YAAY;CAatC"}
|
|
@@ -5,7 +5,7 @@ const internal_exception_1 = require("../internal.exception");
|
|
|
5
5
|
class HTTPException extends internal_exception_1.InternalException {
|
|
6
6
|
constructor(statusCode, statusText, msg = statusText) {
|
|
7
7
|
super(msg);
|
|
8
|
-
this.message
|
|
8
|
+
this.message ||= statusText;
|
|
9
9
|
this.statusCode = statusCode;
|
|
10
10
|
this.statusText = statusText;
|
|
11
11
|
this.response = this.createResponse();
|
|
@@ -24,8 +24,14 @@ class HTTPException extends internal_exception_1.InternalException {
|
|
|
24
24
|
}
|
|
25
25
|
createResponse() {
|
|
26
26
|
const cause = this.getCause();
|
|
27
|
-
return
|
|
27
|
+
return {
|
|
28
|
+
message: this.message,
|
|
29
|
+
statusCode: this.statusCode,
|
|
30
|
+
statusText: this.statusText,
|
|
31
|
+
...(this.details ? { details: this.details } : {}),
|
|
32
|
+
...(this.errorCode ? { errorCode: this.errorCode } : {}),
|
|
33
|
+
...(cause ? { cause } : {}),
|
|
34
|
+
};
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
exports.HTTPException = HTTPException;
|
|
31
|
-
//# sourceMappingURL=http.exception.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ErrorMessage } from
|
|
1
|
+
import { ErrorMessage } from '../error-message.interface';
|
|
2
2
|
import { HTTPException } from './http.exception';
|
|
3
3
|
import { HTTPStatus } from './http-status.enum';
|
|
4
4
|
export interface HTTPExceptionClass {
|
|
5
5
|
new (message?: ErrorMessage): HTTPException;
|
|
6
6
|
}
|
|
7
7
|
export declare const createHTTPException: (statusCode: HTTPStatus, statusText: string) => HTTPExceptionClass;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/http/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,MAAM,WAAW,kBAAkB;IACjC,KAAK,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CAC7C;AAED,eAAO,MAAM,mBAAmB,eAAgB,UAAU,cAAc,MAAM,KAAG,kBAUhF,CAAC"}
|
package/build/cjs/http/utils.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.exception.d.ts","sourceRoot":"","sources":["../../src/internal.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,aAAK,gBAAgB,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;CAClC,CAAC;AAOF,qBAAa,iBAAkB,SAAQ,KAAM,YAAW,SAAS;WACjD,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,iBAAiB;WAI9C,WAAW,CAAC,GAAG,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,SAAS;IAiCnE,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAEvB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEb,GAAG,CAAC,EAAE,YAAY;IAUvB,QAAQ;IAMR,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,IAAI;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;CAGlE;AAGD,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,SAAU,SAAQ,gBAAgB,CAAC,SAAS,CAAC;QAC5D,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;KACpC;CACF"}
|
package/build/cjs/main.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
package/build/cjs/main.js
CHANGED
|
@@ -25,4 +25,3 @@ __exportStar(require("./http/http-4xx.exception"), exports);
|
|
|
25
25
|
__exportStar(require("./http/http-5xx.exception"), exports);
|
|
26
26
|
__exportStar(require("./http/http-status.enum"), exports);
|
|
27
27
|
__exportStar(require("./internal.exception"), exports);
|
|
28
|
-
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorCode } from './error-code.enum';
|
|
1
|
+
import { ErrorCode } from './error-code.enum.js';
|
|
2
2
|
export interface BaseError {
|
|
3
3
|
/**
|
|
4
4
|
* message describing this error
|
|
@@ -13,3 +13,4 @@ export interface BaseError {
|
|
|
13
13
|
*/
|
|
14
14
|
errorCode?: ErrorCode;
|
|
15
15
|
}
|
|
16
|
+
//# sourceMappingURL=base-error.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-error.interface.d.ts","sourceRoot":"","sources":["../../src/base-error.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-response.interface.d.ts","sourceRoot":"","sources":["../../src/base-response.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseResponse } from './base-response.interface';
|
|
2
|
-
import { ErrorCode } from './error-code.enum';
|
|
3
|
-
import { ErrorPayload } from './error-payload.interface';
|
|
1
|
+
import { BaseResponse } from './base-response.interface.js';
|
|
2
|
+
import { ErrorCode } from './error-code.enum.js';
|
|
3
|
+
import { ErrorPayload } from './error-payload.interface.js';
|
|
4
4
|
export declare class ClientException<Res extends BaseResponse = BaseResponse> extends Error implements ErrorPayload {
|
|
5
5
|
static instanceOf(err: any): err is ClientException;
|
|
6
6
|
response: Res;
|
|
@@ -18,3 +18,4 @@ export declare class ClientException<Res extends BaseResponse = BaseResponse> ex
|
|
|
18
18
|
details: Details;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
//# sourceMappingURL=client.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.exception.d.ts","sourceRoot":"","sources":["../../src/client.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBAAa,eAAe,CAAC,GAAG,SAAS,YAAY,GAAG,YAAY,CAAE,SAAQ,KAAM,YAAW,YAAY;WAC3F,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,eAAe;IAInD,QAAQ,EAAE,GAAG,CAAC;IAEd,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEb,QAAQ,EAAE,GAAG;IAQzB,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,kBAAkB;IAInB,QAAQ;IAIF,KAAK;IAYX,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,IAAI;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;CAGlE"}
|
|
@@ -29,7 +29,7 @@ export class ClientException extends Error {
|
|
|
29
29
|
try {
|
|
30
30
|
this.extractDetailedError(JSON.parse(text));
|
|
31
31
|
}
|
|
32
|
-
catch
|
|
32
|
+
catch {
|
|
33
33
|
this.extractOpaqueError(text);
|
|
34
34
|
}
|
|
35
35
|
return this;
|
|
@@ -38,4 +38,3 @@ export class ClientException extends Error {
|
|
|
38
38
|
return this.errorCode === code;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
//# sourceMappingURL=client.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-code.enum.d.ts","sourceRoot":"","sources":["../../src/error-code.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,+BAA+B,oCAAoC;IACnE,8BAA8B,mCAAmC;IAEjE,sBAAsB,2BAA2B;IACjD,wBAAwB,6BAA6B;CACtD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BaseError } from './base-error.interface';
|
|
1
|
+
import { BaseError } from './base-error.interface.js';
|
|
2
2
|
export interface DetailedErrorMessage extends BaseError {
|
|
3
3
|
cause?: unknown;
|
|
4
4
|
}
|
|
5
5
|
export declare type ErrorMessage = string | Error | DetailedErrorMessage;
|
|
6
|
+
//# sourceMappingURL=error-message.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-message.interface.d.ts","sourceRoot":"","sources":["../../src/error-message.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,oBAAY,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from './base-error.interface';
|
|
1
|
+
import { BaseError } from './base-error.interface.js';
|
|
2
2
|
export interface ErrorPayload extends BaseError {
|
|
3
3
|
/**
|
|
4
4
|
* standard HTTP status code
|
|
@@ -13,3 +13,4 @@ export interface ErrorPayload extends BaseError {
|
|
|
13
13
|
*/
|
|
14
14
|
cause?: string;
|
|
15
15
|
}
|
|
16
|
+
//# sourceMappingURL=error-payload.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-payload.interface.d.ts","sourceRoot":"","sources":["../../src/error-payload.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
export declare const BadRequestException: import("./utils").HTTPExceptionClass;
|
|
2
|
-
export declare const UnauthorizedException: import("./utils").HTTPExceptionClass;
|
|
3
|
-
export declare const PaymentRequiredException: import("./utils").HTTPExceptionClass;
|
|
4
|
-
export declare const ForbiddenException: import("./utils").HTTPExceptionClass;
|
|
5
|
-
export declare const NotFoundException: import("./utils").HTTPExceptionClass;
|
|
6
|
-
export declare const MethodNotAllowedException: import("./utils").HTTPExceptionClass;
|
|
7
|
-
export declare const NotAcceptableException: import("./utils").HTTPExceptionClass;
|
|
8
|
-
export declare const ProxyAuthenticationRequiredException: import("./utils").HTTPExceptionClass;
|
|
9
|
-
export declare const RequestTimeoutException: import("./utils").HTTPExceptionClass;
|
|
10
|
-
export declare const ConflictException: import("./utils").HTTPExceptionClass;
|
|
11
|
-
export declare const GoneException: import("./utils").HTTPExceptionClass;
|
|
12
|
-
export declare const LengthRequiredException: import("./utils").HTTPExceptionClass;
|
|
13
|
-
export declare const PreconditionFailedException: import("./utils").HTTPExceptionClass;
|
|
14
|
-
export declare const PayloadTooLargeException: import("./utils").HTTPExceptionClass;
|
|
15
|
-
export declare const URITooLongException: import("./utils").HTTPExceptionClass;
|
|
16
|
-
export declare const UnsupportedMediaTypeException: import("./utils").HTTPExceptionClass;
|
|
17
|
-
export declare const RangeNotSatisfiableException: import("./utils").HTTPExceptionClass;
|
|
18
|
-
export declare const ExpectationFailedException: import("./utils").HTTPExceptionClass;
|
|
19
|
-
export declare const ImATeapotException: import("./utils").HTTPExceptionClass;
|
|
20
|
-
export declare const MisdirectedRequestException: import("./utils").HTTPExceptionClass;
|
|
21
|
-
export declare const UnprocessableEntityException: import("./utils").HTTPExceptionClass;
|
|
22
|
-
export declare const LockedException: import("./utils").HTTPExceptionClass;
|
|
23
|
-
export declare const FailedDependencyException: import("./utils").HTTPExceptionClass;
|
|
24
|
-
export declare const TooEarlyException: import("./utils").HTTPExceptionClass;
|
|
25
|
-
export declare const UpgradeRequiredException: import("./utils").HTTPExceptionClass;
|
|
26
|
-
export declare const PreconditionRequiredException: import("./utils").HTTPExceptionClass;
|
|
27
|
-
export declare const TooManyRequestsException: import("./utils").HTTPExceptionClass;
|
|
28
|
-
export declare const RequestHeaderFieldsTooLargeException: import("./utils").HTTPExceptionClass;
|
|
29
|
-
export declare const UnavailableForLegalReasonsException: import("./utils").HTTPExceptionClass;
|
|
1
|
+
export declare const BadRequestException: import("./utils.js").HTTPExceptionClass;
|
|
2
|
+
export declare const UnauthorizedException: import("./utils.js").HTTPExceptionClass;
|
|
3
|
+
export declare const PaymentRequiredException: import("./utils.js").HTTPExceptionClass;
|
|
4
|
+
export declare const ForbiddenException: import("./utils.js").HTTPExceptionClass;
|
|
5
|
+
export declare const NotFoundException: import("./utils.js").HTTPExceptionClass;
|
|
6
|
+
export declare const MethodNotAllowedException: import("./utils.js").HTTPExceptionClass;
|
|
7
|
+
export declare const NotAcceptableException: import("./utils.js").HTTPExceptionClass;
|
|
8
|
+
export declare const ProxyAuthenticationRequiredException: import("./utils.js").HTTPExceptionClass;
|
|
9
|
+
export declare const RequestTimeoutException: import("./utils.js").HTTPExceptionClass;
|
|
10
|
+
export declare const ConflictException: import("./utils.js").HTTPExceptionClass;
|
|
11
|
+
export declare const GoneException: import("./utils.js").HTTPExceptionClass;
|
|
12
|
+
export declare const LengthRequiredException: import("./utils.js").HTTPExceptionClass;
|
|
13
|
+
export declare const PreconditionFailedException: import("./utils.js").HTTPExceptionClass;
|
|
14
|
+
export declare const PayloadTooLargeException: import("./utils.js").HTTPExceptionClass;
|
|
15
|
+
export declare const URITooLongException: import("./utils.js").HTTPExceptionClass;
|
|
16
|
+
export declare const UnsupportedMediaTypeException: import("./utils.js").HTTPExceptionClass;
|
|
17
|
+
export declare const RangeNotSatisfiableException: import("./utils.js").HTTPExceptionClass;
|
|
18
|
+
export declare const ExpectationFailedException: import("./utils.js").HTTPExceptionClass;
|
|
19
|
+
export declare const ImATeapotException: import("./utils.js").HTTPExceptionClass;
|
|
20
|
+
export declare const MisdirectedRequestException: import("./utils.js").HTTPExceptionClass;
|
|
21
|
+
export declare const UnprocessableEntityException: import("./utils.js").HTTPExceptionClass;
|
|
22
|
+
export declare const LockedException: import("./utils.js").HTTPExceptionClass;
|
|
23
|
+
export declare const FailedDependencyException: import("./utils.js").HTTPExceptionClass;
|
|
24
|
+
export declare const TooEarlyException: import("./utils.js").HTTPExceptionClass;
|
|
25
|
+
export declare const UpgradeRequiredException: import("./utils.js").HTTPExceptionClass;
|
|
26
|
+
export declare const PreconditionRequiredException: import("./utils.js").HTTPExceptionClass;
|
|
27
|
+
export declare const TooManyRequestsException: import("./utils.js").HTTPExceptionClass;
|
|
28
|
+
export declare const RequestHeaderFieldsTooLargeException: import("./utils.js").HTTPExceptionClass;
|
|
29
|
+
export declare const UnavailableForLegalReasonsException: import("./utils.js").HTTPExceptionClass;
|
|
30
|
+
//# sourceMappingURL=http-4xx.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-4xx.exception.d.ts","sourceRoot":"","sources":["../../../src/http/http-4xx.exception.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,sCAA6D,CAAC;AAC9F,eAAO,MAAM,qBAAqB,sCAA+D,CAAC;AAClG,eAAO,MAAM,wBAAwB,sCAAuE,CAAC;AAC7G,eAAO,MAAM,kBAAkB,sCAAyD,CAAC;AACzF,eAAO,MAAM,iBAAiB,sCAAyD,CAAC;AACxF,eAAO,MAAM,yBAAyB,sCAA2E,CAAC;AAClH,eAAO,MAAM,sBAAsB,sCAAmE,CAAC;AACvG,eAAO,MAAM,oCAAoC,sCAAiG,CAAC;AACnJ,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,iBAAiB,sCAAuD,CAAC;AACtF,eAAO,MAAM,aAAa,sCAA+C,CAAC;AAC1E,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,2BAA2B,sCAA6E,CAAC;AACtH,eAAO,MAAM,wBAAwB,sCAAyE,CAAC;AAC/G,eAAO,MAAM,mBAAmB,sCAA+D,CAAC;AAChG,eAAO,MAAM,6BAA6B,sCAAmF,CAAC;AAC9H,eAAO,MAAM,4BAA4B,sCAAiF,CAAC;AAC3H,eAAO,MAAM,0BAA0B,sCAA2E,CAAC;AACnH,eAAO,MAAM,kBAAkB,sCAAgE,CAAC;AAChG,eAAO,MAAM,2BAA2B,sCAA6E,CAAC;AACtH,eAAO,MAAM,4BAA4B,sCAA+E,CAAC;AACzH,eAAO,MAAM,eAAe,sCAAmD,CAAC;AAChF,eAAO,MAAM,yBAAyB,sCAAyE,CAAC;AAChH,eAAO,MAAM,iBAAiB,sCAAyD,CAAC;AACxF,eAAO,MAAM,wBAAwB,sCAAuE,CAAC;AAC7G,eAAO,MAAM,6BAA6B,sCAAiF,CAAC;AAC5H,eAAO,MAAM,wBAAwB,sCAAyE,CAAC;AAC/G,eAAO,MAAM,oCAAoC,sCAGhD,CAAC;AACF,eAAO,MAAM,mCAAmC,sCAAiG,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HTTPStatus } from './http-status.enum';
|
|
2
|
-
import { createHTTPException } from './utils';
|
|
1
|
+
import { HTTPStatus } from './http-status.enum.js';
|
|
2
|
+
import { createHTTPException } from './utils.js';
|
|
3
3
|
export const BadRequestException = createHTTPException(HTTPStatus.BAD_REQUEST, 'Bad Request');
|
|
4
4
|
export const UnauthorizedException = createHTTPException(HTTPStatus.UNAUTHORIZED, 'Unauthorized');
|
|
5
5
|
export const PaymentRequiredException = createHTTPException(HTTPStatus.PAYMENT_REQUIRED, 'Payment Required');
|
|
@@ -29,4 +29,3 @@ export const PreconditionRequiredException = createHTTPException(HTTPStatus.PREC
|
|
|
29
29
|
export const TooManyRequestsException = createHTTPException(HTTPStatus.TOO_MANY_REQUESTS, 'Too Many Requests');
|
|
30
30
|
export const RequestHeaderFieldsTooLargeException = createHTTPException(HTTPStatus.REQUEST_HEADER_FIELDS_TOO_LARGE, 'Request Header Fields Too Large');
|
|
31
31
|
export const UnavailableForLegalReasonsException = createHTTPException(HTTPStatus.UNAVAILABLE_FOR_LEGAL_REASONS, 'Unavailable For Legal Reasons');
|
|
32
|
-
//# sourceMappingURL=http-4xx.exception.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export declare const InternalServerErrorException: import("./utils").HTTPExceptionClass;
|
|
2
|
-
export declare const NotImplementedException: import("./utils").HTTPExceptionClass;
|
|
3
|
-
export declare const BadGatewayException: import("./utils").HTTPExceptionClass;
|
|
4
|
-
export declare const ServiceUnavailableException: import("./utils").HTTPExceptionClass;
|
|
5
|
-
export declare const GatewayTimeoutException: import("./utils").HTTPExceptionClass;
|
|
6
|
-
export declare const HTTPVersionNotSupportedException: import("./utils").HTTPExceptionClass;
|
|
7
|
-
export declare const VariantAlsoNegotiatesException: import("./utils").HTTPExceptionClass;
|
|
8
|
-
export declare const InsufficientStorageException: import("./utils").HTTPExceptionClass;
|
|
9
|
-
export declare const LoopDetectedException: import("./utils").HTTPExceptionClass;
|
|
10
|
-
export declare const NotExtendedException: import("./utils").HTTPExceptionClass;
|
|
11
|
-
export declare const NetworkAuthenticationRequiredException: import("./utils").HTTPExceptionClass;
|
|
1
|
+
export declare const InternalServerErrorException: import("./utils.js").HTTPExceptionClass;
|
|
2
|
+
export declare const NotImplementedException: import("./utils.js").HTTPExceptionClass;
|
|
3
|
+
export declare const BadGatewayException: import("./utils.js").HTTPExceptionClass;
|
|
4
|
+
export declare const ServiceUnavailableException: import("./utils.js").HTTPExceptionClass;
|
|
5
|
+
export declare const GatewayTimeoutException: import("./utils.js").HTTPExceptionClass;
|
|
6
|
+
export declare const HTTPVersionNotSupportedException: import("./utils.js").HTTPExceptionClass;
|
|
7
|
+
export declare const VariantAlsoNegotiatesException: import("./utils.js").HTTPExceptionClass;
|
|
8
|
+
export declare const InsufficientStorageException: import("./utils.js").HTTPExceptionClass;
|
|
9
|
+
export declare const LoopDetectedException: import("./utils.js").HTTPExceptionClass;
|
|
10
|
+
export declare const NotExtendedException: import("./utils.js").HTTPExceptionClass;
|
|
11
|
+
export declare const NetworkAuthenticationRequiredException: import("./utils.js").HTTPExceptionClass;
|
|
12
|
+
//# sourceMappingURL=http-5xx.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-5xx.exception.d.ts","sourceRoot":"","sources":["../../../src/http/http-5xx.exception.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,sCAAiF,CAAC;AAC3H,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,mBAAmB,sCAA6D,CAAC;AAC9F,eAAO,MAAM,2BAA2B,sCAA6E,CAAC;AACtH,eAAO,MAAM,uBAAuB,sCAAqE,CAAC;AAC1G,eAAO,MAAM,gCAAgC,sCAA2F,CAAC;AACzI,eAAO,MAAM,8BAA8B,sCAAqF,CAAC;AACjI,eAAO,MAAM,4BAA4B,sCAA+E,CAAC;AACzH,eAAO,MAAM,qBAAqB,sCAAiE,CAAC;AACpG,eAAO,MAAM,oBAAoB,sCAA+D,CAAC;AACjG,eAAO,MAAM,sCAAsC,sCAGlD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HTTPStatus } from './http-status.enum';
|
|
2
|
-
import { createHTTPException } from './utils';
|
|
1
|
+
import { HTTPStatus } from './http-status.enum.js';
|
|
2
|
+
import { createHTTPException } from './utils.js';
|
|
3
3
|
export const InternalServerErrorException = createHTTPException(HTTPStatus.INTERNAL_SERVER_ERROR, 'Internal Server Error');
|
|
4
4
|
export const NotImplementedException = createHTTPException(HTTPStatus.NOT_IMPLEMENTED, 'Not Implemented');
|
|
5
5
|
export const BadGatewayException = createHTTPException(HTTPStatus.BAD_GATEWAY, 'Bad Gateway');
|
|
@@ -11,4 +11,3 @@ export const InsufficientStorageException = createHTTPException(HTTPStatus.INSUF
|
|
|
11
11
|
export const LoopDetectedException = createHTTPException(HTTPStatus.LOOP_DETECTED, 'Loop Detected');
|
|
12
12
|
export const NotExtendedException = createHTTPException(HTTPStatus.NOT_EXTENDED, 'Not Extended');
|
|
13
13
|
export const NetworkAuthenticationRequiredException = createHTTPException(HTTPStatus.NETWORK_AUTHENTICATION_REQUIRED, 'Network Authentication Required');
|
|
14
|
-
//# sourceMappingURL=http-5xx.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status.enum.d.ts","sourceRoot":"","sources":["../../../src/http/http-status.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAEpB,WAAW,MAAM;IACjB,YAAY,MAAM;IAClB,gBAAgB,MAAM;IACtB,SAAS,MAAM;IACf,SAAS,MAAM;IACf,kBAAkB,MAAM;IACxB,cAAc,MAAM;IACpB,6BAA6B,MAAM;IACnC,eAAe,MAAM;IACrB,QAAQ,MAAM;IACd,IAAI,MAAM;IACV,eAAe,MAAM;IACrB,mBAAmB,MAAM;IACzB,iBAAiB,MAAM;IACvB,YAAY,MAAM;IAClB,sBAAsB,MAAM;IAC5B,qBAAqB,MAAM;IAC3B,kBAAkB,MAAM;IACxB,aAAa,MAAM;IACnB,mBAAmB,MAAM;IACzB,oBAAoB,MAAM;IAC1B,MAAM,MAAM;IACZ,iBAAiB,MAAM;IACvB,SAAS,MAAM;IACf,gBAAgB,MAAM;IACtB,qBAAqB,MAAM;IAC3B,iBAAiB,MAAM;IACvB,+BAA+B,MAAM;IACrC,6BAA6B,MAAM;IAGnC,qBAAqB,MAAM;IAC3B,eAAe,MAAM;IACrB,WAAW,MAAM;IACjB,mBAAmB,MAAM;IACzB,eAAe,MAAM;IACrB,0BAA0B,MAAM;IAChC,uBAAuB,MAAM;IAC7B,oBAAoB,MAAM;IAC1B,aAAa,MAAM;IACnB,YAAY,MAAM;IAClB,+BAA+B,MAAM;CACtC"}
|
|
@@ -43,4 +43,3 @@ export var HTTPStatus;
|
|
|
43
43
|
HTTPStatus[HTTPStatus["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
|
|
44
44
|
HTTPStatus[HTTPStatus["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
45
45
|
})(HTTPStatus || (HTTPStatus = {}));
|
|
46
|
-
//# sourceMappingURL=http-status.enum.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ErrorMessage } from
|
|
2
|
-
import { ErrorPayload } from
|
|
3
|
-
import { InternalException } from
|
|
1
|
+
import { ErrorMessage } from '../error-message.interface.js';
|
|
2
|
+
import { ErrorPayload } from '../error-payload.interface.js';
|
|
3
|
+
import { InternalException } from '../internal.exception.js';
|
|
4
4
|
export interface SerializedHTTPException {
|
|
5
5
|
message: string;
|
|
6
6
|
statusCode: number;
|
|
@@ -16,3 +16,4 @@ export declare class HTTPException extends InternalException implements Serializ
|
|
|
16
16
|
constructor(statusCode: number, statusText: string, msg?: ErrorMessage);
|
|
17
17
|
createResponse(): ErrorPayload;
|
|
18
18
|
}
|
|
19
|
+
//# sourceMappingURL=http.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.exception.d.ts","sourceRoot":"","sources":["../../../src/http/http.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,aAAc,SAAQ,iBAAkB,YAAW,uBAAuB;WACvE,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,aAAa;IAIxD,OAAO,CAAC,MAAM,CAAC,qBAAqB;WAItB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,uBAAuB;IASzE,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC;IAEnB,QAAQ,EAAE,YAAY,CAAC;gBAElB,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,GAAE,YAAyB;IAQ3E,cAAc,IAAI,YAAY;CAatC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InternalException } from
|
|
1
|
+
import { InternalException } from '../internal.exception.js';
|
|
2
2
|
export class HTTPException extends InternalException {
|
|
3
3
|
constructor(statusCode, statusText, msg = statusText) {
|
|
4
4
|
super(msg);
|
|
5
|
-
this.message
|
|
5
|
+
this.message ||= statusText;
|
|
6
6
|
this.statusCode = statusCode;
|
|
7
7
|
this.statusText = statusText;
|
|
8
8
|
this.response = this.createResponse();
|
|
@@ -21,7 +21,13 @@ export class HTTPException extends InternalException {
|
|
|
21
21
|
}
|
|
22
22
|
createResponse() {
|
|
23
23
|
const cause = this.getCause();
|
|
24
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
message: this.message,
|
|
26
|
+
statusCode: this.statusCode,
|
|
27
|
+
statusText: this.statusText,
|
|
28
|
+
...(this.details ? { details: this.details } : {}),
|
|
29
|
+
...(this.errorCode ? { errorCode: this.errorCode } : {}),
|
|
30
|
+
...(cause ? { cause } : {}),
|
|
31
|
+
};
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
|
-
//# sourceMappingURL=http.exception.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ErrorMessage } from
|
|
2
|
-
import { HTTPException } from './http.exception';
|
|
3
|
-
import { HTTPStatus } from './http-status.enum';
|
|
1
|
+
import { ErrorMessage } from '../error-message.interface.js';
|
|
2
|
+
import { HTTPException } from './http.exception.js';
|
|
3
|
+
import { HTTPStatus } from './http-status.enum.js';
|
|
4
4
|
export interface HTTPExceptionClass {
|
|
5
5
|
new (message?: ErrorMessage): HTTPException;
|
|
6
6
|
}
|
|
7
7
|
export declare const createHTTPException: (statusCode: HTTPStatus, statusText: string) => HTTPExceptionClass;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|