@rexezuge/errors 1.2.0 → 1.4.0
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/dist/BadGatewayError.d.ts +1 -1
- package/dist/BadGatewayError.d.ts.map +1 -1
- package/dist/BadGatewayError.js +1 -12
- package/dist/BadGatewayError.js.map +7 -1
- package/dist/BadRequestError.d.ts +1 -1
- package/dist/BadRequestError.d.ts.map +1 -1
- package/dist/BadRequestError.js +1 -11
- package/dist/BadRequestError.js.map +7 -1
- package/dist/CATALOG.js +1 -92
- package/dist/CATALOG.js.map +7 -1
- package/dist/ConflictError.d.ts +1 -1
- package/dist/ConflictError.d.ts.map +1 -1
- package/dist/ConflictError.js +1 -12
- package/dist/ConflictError.js.map +7 -1
- package/dist/DatabaseError.d.ts +1 -1
- package/dist/DatabaseError.d.ts.map +1 -1
- package/dist/DatabaseError.js +1 -18
- package/dist/DatabaseError.js.map +7 -1
- package/dist/ErrorResponse.js +0 -2
- package/dist/ErrorResponse.js.map +7 -1
- package/dist/ForbiddenError.d.ts +1 -1
- package/dist/ForbiddenError.d.ts.map +1 -1
- package/dist/ForbiddenError.js +1 -11
- package/dist/ForbiddenError.js.map +7 -1
- package/dist/HttpServiceError.d.ts +3 -3
- package/dist/HttpServiceError.d.ts.map +1 -1
- package/dist/HttpServiceError.js +1 -16
- package/dist/HttpServiceError.js.map +7 -1
- package/dist/InternalServerError.d.ts +1 -1
- package/dist/InternalServerError.d.ts.map +1 -1
- package/dist/InternalServerError.js +1 -16
- package/dist/InternalServerError.js.map +7 -1
- package/dist/MethodNotAllowedError.d.ts +1 -1
- package/dist/MethodNotAllowedError.d.ts.map +1 -1
- package/dist/MethodNotAllowedError.js +1 -11
- package/dist/MethodNotAllowedError.js.map +7 -1
- package/dist/NotFoundError.d.ts +1 -1
- package/dist/NotFoundError.d.ts.map +1 -1
- package/dist/NotFoundError.js +1 -11
- package/dist/NotFoundError.js.map +7 -1
- package/dist/NotImplementedError.d.ts +1 -1
- package/dist/NotImplementedError.d.ts.map +1 -1
- package/dist/NotImplementedError.js +1 -11
- package/dist/NotImplementedError.js.map +7 -1
- package/dist/OutcomeError.d.ts +2 -2
- package/dist/OutcomeError.d.ts.map +1 -1
- package/dist/OutcomeError.js +1 -50
- package/dist/OutcomeError.js.map +7 -1
- package/dist/PayloadTooLargeError.d.ts +1 -1
- package/dist/PayloadTooLargeError.d.ts.map +1 -1
- package/dist/PayloadTooLargeError.js +1 -11
- package/dist/PayloadTooLargeError.js.map +7 -1
- package/dist/PreconditionFailedError.d.ts +1 -1
- package/dist/PreconditionFailedError.d.ts.map +1 -1
- package/dist/PreconditionFailedError.js +1 -12
- package/dist/PreconditionFailedError.js.map +7 -1
- package/dist/RateLimitedError.d.ts +1 -1
- package/dist/RateLimitedError.d.ts.map +1 -1
- package/dist/RateLimitedError.js +1 -12
- package/dist/RateLimitedError.js.map +7 -1
- package/dist/ServiceError.d.ts +22 -8
- package/dist/ServiceError.d.ts.map +1 -1
- package/dist/ServiceError.js +1 -84
- package/dist/ServiceError.js.map +7 -1
- package/dist/ServiceUnavailableError.d.ts +1 -1
- package/dist/ServiceUnavailableError.d.ts.map +1 -1
- package/dist/ServiceUnavailableError.js +1 -12
- package/dist/ServiceUnavailableError.js.map +7 -1
- package/dist/UnauthorizedError.d.ts +1 -1
- package/dist/UnauthorizedError.d.ts.map +1 -1
- package/dist/UnauthorizedError.js +1 -12
- package/dist/UnauthorizedError.js.map +7 -1
- package/dist/UnsupportedMediaTypeError.d.ts +1 -1
- package/dist/UnsupportedMediaTypeError.d.ts.map +1 -1
- package/dist/UnsupportedMediaTypeError.js +1 -11
- package/dist/UnsupportedMediaTypeError.js.map +7 -1
- package/dist/index.d.ts +22 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -20
- package/dist/index.js.map +7 -1
- package/package.json +2 -2
package/dist/OutcomeError.js
CHANGED
|
@@ -1,50 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* An error whose retryability is decided by the thrower, not deduced.
|
|
4
|
-
*
|
|
5
|
-
* Durable-DAV's `D1ErrorClassifier` can classify a raw D1 message, but a
|
|
6
|
-
* provider-level failure (OAuth2 grant revoked, upstream API rejecting a
|
|
7
|
-
* payload) carries no such signal — only the code that made the call knows.
|
|
8
|
-
* This taxonomy lets that code say so explicitly, and the status defaults
|
|
9
|
-
* follow the retry flag rather than a name-lookup table that could disagree.
|
|
10
|
-
*/
|
|
11
|
-
class OutcomeError extends ServiceError {
|
|
12
|
-
constructor(message, options) {
|
|
13
|
-
super(options.retryable ? 502 : 400, new.target.name, message, options);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Transient upstream failure: a later attempt may succeed (throttling, 5xx
|
|
18
|
-
* from the provider, token refresh race). Status 502 by default.
|
|
19
|
-
*/
|
|
20
|
-
class RetryableError extends OutcomeError {
|
|
21
|
-
constructor(message, status) {
|
|
22
|
-
super(message, { retryable: true, ...(status === undefined ? {} : { expose: status < 500 }) });
|
|
23
|
-
if (status !== undefined) {
|
|
24
|
-
this.status = status;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Permanent failure: retrying repeats the failure forever. A revoked grant
|
|
30
|
-
* retried every ten minutes told the caller the request was a server fault;
|
|
31
|
-
* this class exists so that never reads as retryable again. Status 400.
|
|
32
|
-
*/
|
|
33
|
-
class NonRetryableError extends OutcomeError {
|
|
34
|
-
constructor(message, status) {
|
|
35
|
-
super(message, { retryable: false, ...(status === undefined ? {} : { expose: status < 500 }) });
|
|
36
|
-
if (status !== undefined) {
|
|
37
|
-
this.status = status;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
class ProviderApiRetryableError extends RetryableError {
|
|
42
|
-
}
|
|
43
|
-
class ProviderApiNonRetryableError extends NonRetryableError {
|
|
44
|
-
}
|
|
45
|
-
class OAuth2TokenRetryableError extends RetryableError {
|
|
46
|
-
}
|
|
47
|
-
class OAuth2TokenNonRetryableError extends NonRetryableError {
|
|
48
|
-
}
|
|
49
|
-
export { NonRetryableError, OAuth2TokenNonRetryableError, OAuth2TokenRetryableError, OutcomeError, ProviderApiNonRetryableError, ProviderApiRetryableError, RetryableError, };
|
|
50
|
-
//# sourceMappingURL=OutcomeError.js.map
|
|
1
|
+
import{ServiceError as d}from"./ServiceError.js";class n extends d{constructor(o,e){super(e.retryable?502:400,new.target.name,o,e)}}class s extends n{constructor(o,e){super(o,{retryable:!0,...e!==void 0&&{expose:e<500}}),e!==void 0&&(this.status=e)}}class t extends n{constructor(o,e){super(o,{retryable:!1,...e!==void 0&&{expose:e<500}}),e!==void 0&&(this.status=e)}}class l extends s{}class a extends t{}class c extends s{}class i extends t{}export{t as NonRetryableError,i as OAuth2TokenNonRetryableError,c as OAuth2TokenRetryableError,n as OutcomeError,a as ProviderApiNonRetryableError,l as ProviderApiRetryableError,s as RetryableError};
|
package/dist/OutcomeError.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/OutcomeError.ts"],
|
|
4
|
+
"sourcesContent": ["import { ServiceError } from './ServiceError.ts';\nimport type { ServiceErrorOptions } from './ServiceError.ts';\n\n/**\n * An error whose retryability is decided by the thrower, not deduced.\n *\n * Durable-DAV's `D1ErrorClassifier` can classify a raw D1 message, but a\n * provider-level failure (OAuth2 grant revoked, upstream API rejecting a\n * payload) carries no such signal — only the code that made the call knows.\n * This taxonomy lets that code say so explicitly, and the status defaults\n * follow the retry flag rather than a name-lookup table that could disagree.\n */\nclass OutcomeError extends ServiceError {\n constructor(message: string, options: ServiceErrorOptions & { retryable: boolean }) {\n super(options.retryable ? 502 : 400, new.target.name, message, options);\n }\n}\n\n/**\n * Transient upstream failure: a later attempt may succeed (throttling, 5xx\n * from the provider, token refresh race). Status 502 by default.\n */\nclass RetryableError extends OutcomeError {\n constructor(message: string, status?: number) {\n super(message, { retryable: true, ...(status !== undefined && { expose: status < 500 }) });\n if (status !== undefined) {\n this.status = status;\n }\n }\n}\n\n/**\n * Permanent failure: retrying repeats the failure forever. A revoked grant\n * retried every ten minutes told the caller the request was a server fault;\n * this class exists so that never reads as retryable again. Status 400.\n */\nclass NonRetryableError extends OutcomeError {\n constructor(message: string, status?: number) {\n super(message, { retryable: false, ...(status !== undefined && { expose: status < 500 }) });\n if (status !== undefined) {\n this.status = status;\n }\n }\n}\n\nclass ProviderApiRetryableError extends RetryableError {}\nclass ProviderApiNonRetryableError extends NonRetryableError {}\nclass OAuth2TokenRetryableError extends RetryableError {}\nclass OAuth2TokenNonRetryableError extends NonRetryableError {}\n\nexport {\n NonRetryableError,\n OAuth2TokenNonRetryableError,\n OAuth2TokenRetryableError,\n OutcomeError,\n ProviderApiNonRetryableError,\n ProviderApiRetryableError,\n RetryableError,\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,gBAAAA,MAAoB,oBAY7B,MAAMC,UAAqBD,CAAY,CACrC,YAAYE,EAAiBC,EAAqD,CAChF,MAAMA,EAAQ,UAAY,IAAM,IAAK,WAAW,KAAMD,EAASC,CAAO,CACxE,EAOF,MAAMC,UAAuBH,CAAY,CACvC,YAAYC,EAAiBG,EAAe,CAC1C,MAAMH,EAAS,CAAE,UAAW,GAAM,GAAIG,IAAW,QAAa,CAAE,OAAQA,EAAS,GAAG,CAAG,CAAE,EACrFA,IAAW,SACb,KAAK,OAASA,EAElB,EAQF,MAAMC,UAA0BL,CAAY,CAC1C,YAAYC,EAAiBG,EAAe,CAC1C,MAAMH,EAAS,CAAE,UAAW,GAAO,GAAIG,IAAW,QAAa,CAAE,OAAQA,EAAS,GAAG,CAAG,CAAE,EACtFA,IAAW,SACb,KAAK,OAASA,EAElB,EAGF,MAAME,UAAkCH,CAAc,EACtD,MAAMI,UAAqCF,CAAiB,EAC5D,MAAMG,UAAkCL,CAAc,EACtD,MAAMM,UAAqCJ,CAAiB",
|
|
6
|
+
"names": ["ServiceError", "OutcomeError", "message", "options", "RetryableError", "status", "NonRetryableError", "ProviderApiRetryableError", "ProviderApiNonRetryableError", "OAuth2TokenRetryableError", "OAuth2TokenNonRetryableError"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadTooLargeError.d.ts","sourceRoot":"","sources":["../src/PayloadTooLargeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PayloadTooLargeError.d.ts","sourceRoot":"","sources":["../src/PayloadTooLargeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,oBAAqB,SAAQ,gBAAgB,CAAC,iBAAiB,CAAC;gBACxD,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* 413 — the payload exceeds the server's limits (request body, file, batch).
|
|
4
|
-
*/
|
|
5
|
-
class PayloadTooLargeError extends HttpServiceError {
|
|
6
|
-
constructor(message) {
|
|
7
|
-
super('PayloadTooLarge', message);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export { PayloadTooLargeError };
|
|
11
|
-
//# sourceMappingURL=PayloadTooLargeError.js.map
|
|
1
|
+
import{HttpServiceError as o}from"./HttpServiceError.js";class e extends o{constructor(r){super("PayloadTooLarge",r)}}export{e as PayloadTooLargeError};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/PayloadTooLargeError.ts"],
|
|
4
|
+
"sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 413 — the payload exceeds the server's limits (request body, file, batch).\n */\nclass PayloadTooLargeError extends HttpServiceError<'PayloadTooLarge'> {\n constructor(message?: string) {\n super('PayloadTooLarge', message);\n }\n}\n\nexport { PayloadTooLargeError };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAA6BD,CAAmC,CACpE,YAAYE,EAAgB,CAC1B,MAAM,kBAAmBA,CAAO,CAClC",
|
|
6
|
+
"names": ["HttpServiceError", "PayloadTooLargeError", "message"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreconditionFailedError.d.ts","sourceRoot":"","sources":["../src/PreconditionFailedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PreconditionFailedError.d.ts","sourceRoot":"","sources":["../src/PreconditionFailedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,cAAM,uBAAwB,SAAQ,gBAAgB,CAAC,oBAAoB,CAAC;gBAC9D,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* 412 — a precondition the caller supplied (e.g. `If-Match`, expected state)
|
|
4
|
-
* did not hold. Retrying unmodified fails by definition.
|
|
5
|
-
*/
|
|
6
|
-
class PreconditionFailedError extends HttpServiceError {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super('PreconditionFailed', message);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export { PreconditionFailedError };
|
|
12
|
-
//# sourceMappingURL=PreconditionFailedError.js.map
|
|
1
|
+
import{HttpServiceError as o}from"./HttpServiceError.js";class e extends o{constructor(r){super("PreconditionFailed",r)}}export{e as PreconditionFailedError};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/PreconditionFailedError.ts"],
|
|
4
|
+
"sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 412 — a precondition the caller supplied (e.g. `If-Match`, expected state)\n * did not hold. Retrying unmodified fails by definition.\n */\nclass PreconditionFailedError extends HttpServiceError<'PreconditionFailed'> {\n constructor(message?: string) {\n super('PreconditionFailed', message);\n }\n}\n\nexport { PreconditionFailedError };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAMjC,MAAMC,UAAgCD,CAAsC,CAC1E,YAAYE,EAAgB,CAC1B,MAAM,qBAAsBA,CAAO,CACrC",
|
|
6
|
+
"names": ["HttpServiceError", "PreconditionFailedError", "message"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RateLimitedError.d.ts","sourceRoot":"","sources":["../src/RateLimitedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RateLimitedError.d.ts","sourceRoot":"","sources":["../src/RateLimitedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,cAAM,gBAAiB,SAAQ,gBAAgB,CAAC,aAAa,CAAC;gBAChD,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/RateLimitedError.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* 429 — the caller exceeded its rate budget. Retrying is not just futile but
|
|
4
|
-
* punished; honor `retryAfter`-style backoff at the caller.
|
|
5
|
-
*/
|
|
6
|
-
class RateLimitedError extends HttpServiceError {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super('RateLimited', message);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export { RateLimitedError };
|
|
12
|
-
//# sourceMappingURL=RateLimitedError.js.map
|
|
1
|
+
import{HttpServiceError as t}from"./HttpServiceError.js";class e extends t{constructor(r){super("RateLimited",r)}}export{e as RateLimitedError};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/RateLimitedError.ts"],
|
|
4
|
+
"sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 429 — the caller exceeded its rate budget. Retrying is not just futile but\n * punished; honor `retryAfter`-style backoff at the caller.\n */\nclass RateLimitedError extends HttpServiceError<'RateLimited'> {\n constructor(message?: string) {\n super('RateLimited', message);\n }\n}\n\nexport { RateLimitedError };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAMjC,MAAMC,UAAyBD,CAA+B,CAC5D,YAAYE,EAAgB,CAC1B,MAAM,cAAeA,CAAO,CAC9B",
|
|
6
|
+
"names": ["HttpServiceError", "RateLimitedError", "message"]
|
|
7
|
+
}
|
package/dist/ServiceError.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type { ErrorResponse } from './ErrorResponse';
|
|
1
|
+
import type { ErrorResponse } from './ErrorResponse.ts';
|
|
2
2
|
interface ServiceErrorOptions {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
Marks a transient failure: a caller retrying is meaningful.
|
|
5
|
+
*/
|
|
4
6
|
retryable?: boolean;
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
Whether the raw message may reach a client. Defaults to `status < 500`.
|
|
9
|
+
*/
|
|
6
10
|
expose?: boolean;
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
Underlying cause, preserved for operator-facing logs.
|
|
13
|
+
*/
|
|
8
14
|
cause?: unknown;
|
|
9
15
|
}
|
|
10
16
|
interface ErrorHttpPayload {
|
|
@@ -24,13 +30,21 @@ interface ErrorHttpPayload {
|
|
|
24
30
|
* than they were ever written.
|
|
25
31
|
*/
|
|
26
32
|
declare abstract class ServiceError extends Error {
|
|
27
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
The HTTP status. Defaults from the catalog; a subclass may refine it.
|
|
35
|
+
*/
|
|
28
36
|
status: number;
|
|
29
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
Overridable by subclasses whose identity differs from the HTTP class name.
|
|
39
|
+
*/
|
|
30
40
|
type: string;
|
|
31
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
False by default: retrying is the exception, not the rule.
|
|
43
|
+
*/
|
|
32
44
|
retryable: boolean;
|
|
33
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
Whether the raw message may reach a client. Defaults to `status < 500`.
|
|
47
|
+
*/
|
|
34
48
|
expose: boolean;
|
|
35
49
|
constructor(status: number, type: string, message: string, options?: ServiceErrorOptions);
|
|
36
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceError.d.ts","sourceRoot":"","sources":["../src/ServiceError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ServiceError.d.ts","sourceRoot":"","sources":["../src/ServiceError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,UAAU,mBAAmB;IAC3B;;MAEE;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;MAEE;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;MAEE;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;CACrB;AAID;;;;;;;;;;;GAWG;AACH,uBAAe,YAAa,SAAQ,KAAK;IACvC;;MAEE;IACK,MAAM,EAAE,MAAM,CAAC;IAEtB;;MAEE;IACK,IAAI,EAAE,MAAM,CAAC;IAEpB;;MAEE;IACK,SAAS,EAAE,OAAO,CAAC;IAE1B;;MAEE;IACK,MAAM,EAAE,OAAO,CAAC;gBAEX,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;IAexF;;;;;;OAMG;IACI,eAAe,IAAI,gBAAgB;IAa1C;;;;;;;OAOG;WACW,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;CASjD;AAED;;;GAGG;AACH,cAAM,oBAAqB,SAAQ,YAAY;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;CAG3D;AAED,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/ServiceError.js
CHANGED
|
@@ -1,84 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
/**
|
|
3
|
-
* Root of the error taxonomy.
|
|
4
|
-
*
|
|
5
|
-
* Every boundary in the family (route handlers, middleware, background tasks)
|
|
6
|
-
* branches on `instanceof ServiceError`, so every concrete error must genuinely
|
|
7
|
-
* extend it — an `implements` leaves the prototype chain broken and silently
|
|
8
|
-
* masks typed errors as generic 500s.
|
|
9
|
-
*
|
|
10
|
-
* Status/type/retryable/expose are public fields, not methods: the values are
|
|
11
|
-
* fixed at construction, and callers in all nine repos read them far more often
|
|
12
|
-
* than they were ever written.
|
|
13
|
-
*/
|
|
14
|
-
class ServiceError extends Error {
|
|
15
|
-
/** The HTTP status. Defaults from the catalog; a subclass may refine it. */
|
|
16
|
-
status;
|
|
17
|
-
/** Overridable by subclasses whose identity differs from the HTTP class name. */
|
|
18
|
-
type;
|
|
19
|
-
/** False by default: retrying is the exception, not the rule. */
|
|
20
|
-
retryable;
|
|
21
|
-
/** Whether the raw message may reach a client. Defaults to `status < 500`. */
|
|
22
|
-
expose;
|
|
23
|
-
constructor(status, type, message, options) {
|
|
24
|
-
super(message);
|
|
25
|
-
// `new.target.name` rather than the passed type: a subclass reports itself
|
|
26
|
-
// even if its author forgot to name it, so log lines and client payloads
|
|
27
|
-
// never disagree about what failed.
|
|
28
|
-
this.name = new.target.name;
|
|
29
|
-
this.status = status;
|
|
30
|
-
this.type = type;
|
|
31
|
-
this.retryable = options?.retryable ?? false;
|
|
32
|
-
this.expose = options?.expose ?? status < 500;
|
|
33
|
-
if (options?.cause !== undefined) {
|
|
34
|
-
this.cause = options.cause;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The wire form: status plus the family's `ErrorResponse` envelope.
|
|
39
|
-
*
|
|
40
|
-
* A non-exposing error (5xx) has its message substituted — `message` is for
|
|
41
|
-
* operators, and pushing it to clients leaks internals. The substitution
|
|
42
|
-
* lives here, once, rather than in nine boundary mappers.
|
|
43
|
-
*/
|
|
44
|
-
toErrorResponse() {
|
|
45
|
-
const message = this.expose ? this.message : INTERNAL_SERVER_MESSAGE;
|
|
46
|
-
return {
|
|
47
|
-
status: this.status,
|
|
48
|
-
body: {
|
|
49
|
-
Exception: {
|
|
50
|
-
Type: this.type,
|
|
51
|
-
Message: message,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Normalize an unknown catch-block value into the taxonomy.
|
|
58
|
-
*
|
|
59
|
-
* A `ServiceError` passes through untouched (re-wrapping would bury its
|
|
60
|
-
* context); anything else becomes a non-retryable 500 carrying the original
|
|
61
|
-
* message and cause. Boundary code should call this before mapping an error
|
|
62
|
-
* to a response, so `error instanceof ServiceError` is guaranteed downstream.
|
|
63
|
-
*/
|
|
64
|
-
static from(error) {
|
|
65
|
-
if (error instanceof ServiceError) {
|
|
66
|
-
return error;
|
|
67
|
-
}
|
|
68
|
-
if (error instanceof Error) {
|
|
69
|
-
return new InternalServiceError(error.message, { cause: error });
|
|
70
|
-
}
|
|
71
|
-
return new InternalServiceError(String(error), { cause: error });
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Private throwable used by `ServiceError.from` for pass-through wrapping.
|
|
76
|
-
* Not exported: reach `InternalServerError` for the public 500.
|
|
77
|
-
*/
|
|
78
|
-
class InternalServiceError extends ServiceError {
|
|
79
|
-
constructor(message, options) {
|
|
80
|
-
super(500, 'InternalError', message, options);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
export { ServiceError, InternalServiceError };
|
|
84
|
-
//# sourceMappingURL=ServiceError.js.map
|
|
1
|
+
const u="The server encountered an internal error and was unable to complete your request.";class t extends Error{status;type;retryable;expose;constructor(e,r,a,s){super(a),this.name=new.target.name,this.status=e,this.type=r,this.retryable=s?.retryable??!1,this.expose=s?.expose??e<500,s?.cause!==void 0&&(this.cause=s.cause)}toErrorResponse(){const e=this.expose?this.message:u;return{status:this.status,body:{Exception:{Type:this.type,Message:e}}}}static from(e){return e instanceof t?e:e instanceof Error?new n(e.message,{cause:e}):new n(String(e),{cause:e})}}class n extends t{constructor(e,r){super(500,"InternalError",e,r)}}export{n as InternalServiceError,t as ServiceError};
|
package/dist/ServiceError.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ServiceError.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ErrorResponse } from './ErrorResponse.ts';\n\ninterface ServiceErrorOptions {\n /**\n Marks a transient failure: a caller retrying is meaningful.\n */\n retryable?: boolean;\n /**\n Whether the raw message may reach a client. Defaults to `status < 500`.\n */\n expose?: boolean;\n /**\n Underlying cause, preserved for operator-facing logs.\n */\n cause?: unknown;\n}\n\ninterface ErrorHttpPayload {\n status: number;\n body: ErrorResponse;\n}\n\nconst INTERNAL_SERVER_MESSAGE = 'The server encountered an internal error and was unable to complete your request.';\n\n/**\n * Root of the error taxonomy.\n *\n * Every boundary in the family (route handlers, middleware, background tasks)\n * branches on `instanceof ServiceError`, so every concrete error must genuinely\n * extend it — an `implements` leaves the prototype chain broken and silently\n * masks typed errors as generic 500s.\n *\n * Status/type/retryable/expose are public fields, not methods: the values are\n * fixed at construction, and callers in all nine repos read them far more often\n * than they were ever written.\n */\nabstract class ServiceError extends Error {\n /**\n The HTTP status. Defaults from the catalog; a subclass may refine it.\n */\n public status: number;\n\n /**\n Overridable by subclasses whose identity differs from the HTTP class name.\n */\n public type: string;\n\n /**\n False by default: retrying is the exception, not the rule.\n */\n public retryable: boolean;\n\n /**\n Whether the raw message may reach a client. Defaults to `status < 500`.\n */\n public expose: boolean;\n\n constructor(status: number, type: string, message: string, options?: ServiceErrorOptions) {\n super(message);\n // `new.target.name` rather than the passed type: a subclass reports itself\n // even if its author forgot to name it, so log lines and client payloads\n // never disagree about what failed.\n this.name = new.target.name;\n this.status = status;\n this.type = type;\n this.retryable = options?.retryable ?? false;\n this.expose = options?.expose ?? status < 500;\n if (options?.cause !== undefined) {\n this.cause = options.cause;\n }\n }\n\n /**\n * The wire form: status plus the family's `ErrorResponse` envelope.\n *\n * A non-exposing error (5xx) has its message substituted — `message` is for\n * operators, and pushing it to clients leaks internals. The substitution\n * lives here, once, rather than in nine boundary mappers.\n */\n public toErrorResponse(): ErrorHttpPayload {\n const message: string = this.expose ? this.message : INTERNAL_SERVER_MESSAGE;\n return {\n status: this.status,\n body: {\n Exception: {\n Type: this.type,\n Message: message,\n },\n },\n };\n }\n\n /**\n * Normalize an unknown catch-block value into the taxonomy.\n *\n * A `ServiceError` passes through untouched (re-wrapping would bury its\n * context); anything else becomes a non-retryable 500 carrying the original\n * message and cause. Boundary code should call this before mapping an error\n * to a response, so `error instanceof ServiceError` is guaranteed downstream.\n */\n public static from(error: unknown): ServiceError {\n if (error instanceof ServiceError) {\n return error;\n }\n if (error instanceof Error) {\n return new InternalServiceError(error.message, { cause: error });\n }\n return new InternalServiceError(String(error), { cause: error });\n }\n}\n\n/**\n * Private throwable used by `ServiceError.from` for pass-through wrapping.\n * Not exported: reach `InternalServerError` for the public 500.\n */\nclass InternalServiceError extends ServiceError {\n constructor(message: string, options?: ServiceErrorOptions) {\n super(500, 'InternalError', message, options);\n }\n}\n\nexport { ServiceError, InternalServiceError };\nexport type { ServiceErrorOptions, ErrorHttpPayload };\n"],
|
|
5
|
+
"mappings": "AAsBA,MAAMA,EAA0B,oFAchC,MAAeC,UAAqB,KAAK,CAIhC,OAKA,KAKA,UAKA,OAEP,YAAYC,EAAgBC,EAAcC,EAAiBC,EAA6B,CACtF,MAAMD,CAAO,EAIb,KAAK,KAAO,WAAW,KACvB,KAAK,OAASF,EACd,KAAK,KAAOC,EACZ,KAAK,UAAYE,GAAS,WAAa,GACvC,KAAK,OAASA,GAAS,QAAUH,EAAS,IACtCG,GAAS,QAAU,SACrB,KAAK,MAAQA,EAAQ,MAEzB,CASO,iBAAe,CACpB,MAAMD,EAAkB,KAAK,OAAS,KAAK,QAAUJ,EACrD,MAAO,CACL,OAAQ,KAAK,OACb,KAAM,CACJ,UAAW,CACT,KAAM,KAAK,KACX,QAASI,IAIjB,CAUO,OAAO,KAAKE,EAAc,CAC/B,OAAIA,aAAiBL,EACZK,EAELA,aAAiB,MACZ,IAAIC,EAAqBD,EAAM,QAAS,CAAE,MAAOA,CAAK,CAAE,EAE1D,IAAIC,EAAqB,OAAOD,CAAK,EAAG,CAAE,MAAOA,CAAK,CAAE,CACjE,EAOF,MAAMC,UAA6BN,CAAY,CAC7C,YAAYG,EAAiBC,EAA6B,CACxD,MAAM,IAAK,gBAAiBD,EAASC,CAAO,CAC9C",
|
|
6
|
+
"names": ["INTERNAL_SERVER_MESSAGE", "ServiceError", "status", "type", "message", "options", "error", "InternalServiceError"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceUnavailableError.d.ts","sourceRoot":"","sources":["../src/ServiceUnavailableError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ServiceUnavailableError.d.ts","sourceRoot":"","sources":["../src/ServiceUnavailableError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,cAAM,uBAAwB,SAAQ,gBAAgB,CAAC,oBAAoB,CAAC;gBAC9D,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* 503 — unavailable now, healthy later. The natural status for retryable
|
|
4
|
-
* infrastructure failures (a locked D1, an overloaded upstream).
|
|
5
|
-
*/
|
|
6
|
-
class ServiceUnavailableError extends HttpServiceError {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super('ServiceUnavailable', message);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export { ServiceUnavailableError };
|
|
12
|
-
//# sourceMappingURL=ServiceUnavailableError.js.map
|
|
1
|
+
import{HttpServiceError as e}from"./HttpServiceError.js";class a extends e{constructor(r){super("ServiceUnavailable",r)}}export{a as ServiceUnavailableError};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ServiceUnavailableError.ts"],
|
|
4
|
+
"sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 503 — unavailable now, healthy later. The natural status for retryable\n * infrastructure failures (a locked D1, an overloaded upstream).\n */\nclass ServiceUnavailableError extends HttpServiceError<'ServiceUnavailable'> {\n constructor(message?: string) {\n super('ServiceUnavailable', message);\n }\n}\n\nexport { ServiceUnavailableError };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAMjC,MAAMC,UAAgCD,CAAsC,CAC1E,YAAYE,EAAgB,CAC1B,MAAM,qBAAsBA,CAAO,CACrC",
|
|
6
|
+
"names": ["HttpServiceError", "ServiceUnavailableError", "message"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnauthorizedError.d.ts","sourceRoot":"","sources":["../src/UnauthorizedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"UnauthorizedError.d.ts","sourceRoot":"","sources":["../src/UnauthorizedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,cAAM,iBAAkB,SAAQ,gBAAgB,CAAC,cAAc,CAAC;gBAClD,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* 401 — credentials missing, expired, or rejected. Distinct from `Forbidden`:
|
|
4
|
-
* re-authenticating may help; `Forbidden` it will not.
|
|
5
|
-
*/
|
|
6
|
-
class UnauthorizedError extends HttpServiceError {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super('Unauthorized', message);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export { UnauthorizedError };
|
|
12
|
-
//# sourceMappingURL=UnauthorizedError.js.map
|
|
1
|
+
import{HttpServiceError as o}from"./HttpServiceError.js";class t extends o{constructor(r){super("Unauthorized",r)}}export{t as UnauthorizedError};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/UnauthorizedError.ts"],
|
|
4
|
+
"sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 401 — credentials missing, expired, or rejected. Distinct from `Forbidden`:\n * re-authenticating may help; `Forbidden` it will not.\n */\nclass UnauthorizedError extends HttpServiceError<'Unauthorized'> {\n constructor(message?: string) {\n super('Unauthorized', message);\n }\n}\n\nexport { UnauthorizedError };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAMjC,MAAMC,UAA0BD,CAAgC,CAC9D,YAAYE,EAAgB,CAC1B,MAAM,eAAgBA,CAAO,CAC/B",
|
|
6
|
+
"names": ["HttpServiceError", "UnauthorizedError", "message"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnsupportedMediaTypeError.d.ts","sourceRoot":"","sources":["../src/UnsupportedMediaTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"UnsupportedMediaTypeError.d.ts","sourceRoot":"","sources":["../src/UnsupportedMediaTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,yBAA0B,SAAQ,gBAAgB,CAAC,sBAAsB,CAAC;gBAClE,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* 415 — the body's content type is not one the endpoint can parse.
|
|
4
|
-
*/
|
|
5
|
-
class UnsupportedMediaTypeError extends HttpServiceError {
|
|
6
|
-
constructor(message) {
|
|
7
|
-
super('UnsupportedMediaType', message);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export { UnsupportedMediaTypeError };
|
|
11
|
-
//# sourceMappingURL=UnsupportedMediaTypeError.js.map
|
|
1
|
+
import{HttpServiceError as e}from"./HttpServiceError.js";class p extends e{constructor(r){super("UnsupportedMediaType",r)}}export{p as UnsupportedMediaTypeError};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/UnsupportedMediaTypeError.ts"],
|
|
4
|
+
"sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 415 — the body's content type is not one the endpoint can parse.\n */\nclass UnsupportedMediaTypeError extends HttpServiceError<'UnsupportedMediaType'> {\n constructor(message?: string) {\n super('UnsupportedMediaType', message);\n }\n}\n\nexport { UnsupportedMediaTypeError };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAAkCD,CAAwC,CAC9E,YAAYE,EAAgB,CAC1B,MAAM,uBAAwBA,CAAO,CACvC",
|
|
6
|
+
"names": ["HttpServiceError", "UnsupportedMediaTypeError", "message"]
|
|
7
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export { CATALOG } from './CATALOG';
|
|
2
|
-
export type { HttpErrorDefinition, HttpErrorType } from './CATALOG';
|
|
3
|
-
export { ServiceError } from './ServiceError';
|
|
4
|
-
export type { ServiceErrorOptions, ErrorHttpPayload } from './ServiceError';
|
|
5
|
-
export { HttpServiceError } from './HttpServiceError';
|
|
6
|
-
export { BadRequestError } from './BadRequestError';
|
|
7
|
-
export { UnauthorizedError } from './UnauthorizedError';
|
|
8
|
-
export { ForbiddenError } from './ForbiddenError';
|
|
9
|
-
export { NotFoundError } from './NotFoundError';
|
|
10
|
-
export { MethodNotAllowedError } from './MethodNotAllowedError';
|
|
11
|
-
export { ConflictError } from './ConflictError';
|
|
12
|
-
export { PreconditionFailedError } from './PreconditionFailedError';
|
|
13
|
-
export { PayloadTooLargeError } from './PayloadTooLargeError';
|
|
14
|
-
export { UnsupportedMediaTypeError } from './UnsupportedMediaTypeError';
|
|
15
|
-
export { RateLimitedError } from './RateLimitedError';
|
|
16
|
-
export { InternalServerError, DefaultInternalServerError } from './InternalServerError';
|
|
17
|
-
export { NotImplementedError } from './NotImplementedError';
|
|
18
|
-
export { BadGatewayError } from './BadGatewayError';
|
|
19
|
-
export { ServiceUnavailableError } from './ServiceUnavailableError';
|
|
20
|
-
export { DatabaseError } from './DatabaseError';
|
|
21
|
-
export { NonRetryableError, OAuth2TokenNonRetryableError, OAuth2TokenRetryableError, OutcomeError, ProviderApiNonRetryableError, ProviderApiRetryableError, RetryableError, } from './OutcomeError';
|
|
22
|
-
export type { ErrorResponse } from './ErrorResponse';
|
|
1
|
+
export { CATALOG } from './CATALOG.ts';
|
|
2
|
+
export type { HttpErrorDefinition, HttpErrorType } from './CATALOG.ts';
|
|
3
|
+
export { ServiceError } from './ServiceError.ts';
|
|
4
|
+
export type { ServiceErrorOptions, ErrorHttpPayload } from './ServiceError.ts';
|
|
5
|
+
export { HttpServiceError } from './HttpServiceError.ts';
|
|
6
|
+
export { BadRequestError } from './BadRequestError.ts';
|
|
7
|
+
export { UnauthorizedError } from './UnauthorizedError.ts';
|
|
8
|
+
export { ForbiddenError } from './ForbiddenError.ts';
|
|
9
|
+
export { NotFoundError } from './NotFoundError.ts';
|
|
10
|
+
export { MethodNotAllowedError } from './MethodNotAllowedError.ts';
|
|
11
|
+
export { ConflictError } from './ConflictError.ts';
|
|
12
|
+
export { PreconditionFailedError } from './PreconditionFailedError.ts';
|
|
13
|
+
export { PayloadTooLargeError } from './PayloadTooLargeError.ts';
|
|
14
|
+
export { UnsupportedMediaTypeError } from './UnsupportedMediaTypeError.ts';
|
|
15
|
+
export { RateLimitedError } from './RateLimitedError.ts';
|
|
16
|
+
export { InternalServerError, DefaultInternalServerError } from './InternalServerError.ts';
|
|
17
|
+
export { NotImplementedError } from './NotImplementedError.ts';
|
|
18
|
+
export { BadGatewayError } from './BadGatewayError.ts';
|
|
19
|
+
export { ServiceUnavailableError } from './ServiceUnavailableError.ts';
|
|
20
|
+
export { DatabaseError } from './DatabaseError.ts';
|
|
21
|
+
export { NonRetryableError, OAuth2TokenNonRetryableError, OAuth2TokenRetryableError, OutcomeError, ProviderApiNonRetryableError, ProviderApiRetryableError, RetryableError, } from './OutcomeError.ts';
|
|
22
|
+
export type { ErrorResponse } from './ErrorResponse.ts';
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,4BAA4B,EAC5B,yBAAyB,EACzB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { ServiceError } from './ServiceError';
|
|
3
|
-
export { HttpServiceError } from './HttpServiceError';
|
|
4
|
-
export { BadRequestError } from './BadRequestError';
|
|
5
|
-
export { UnauthorizedError } from './UnauthorizedError';
|
|
6
|
-
export { ForbiddenError } from './ForbiddenError';
|
|
7
|
-
export { NotFoundError } from './NotFoundError';
|
|
8
|
-
export { MethodNotAllowedError } from './MethodNotAllowedError';
|
|
9
|
-
export { ConflictError } from './ConflictError';
|
|
10
|
-
export { PreconditionFailedError } from './PreconditionFailedError';
|
|
11
|
-
export { PayloadTooLargeError } from './PayloadTooLargeError';
|
|
12
|
-
export { UnsupportedMediaTypeError } from './UnsupportedMediaTypeError';
|
|
13
|
-
export { RateLimitedError } from './RateLimitedError';
|
|
14
|
-
export { InternalServerError, DefaultInternalServerError } from './InternalServerError';
|
|
15
|
-
export { NotImplementedError } from './NotImplementedError';
|
|
16
|
-
export { BadGatewayError } from './BadGatewayError';
|
|
17
|
-
export { ServiceUnavailableError } from './ServiceUnavailableError';
|
|
18
|
-
export { DatabaseError } from './DatabaseError';
|
|
19
|
-
export { NonRetryableError, OAuth2TokenNonRetryableError, OAuth2TokenRetryableError, OutcomeError, ProviderApiNonRetryableError, ProviderApiRetryableError, RetryableError, } from './OutcomeError';
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{CATALOG as e}from"./CATALOG.js";import{ServiceError as a}from"./ServiceError.js";import{HttpServiceError as E}from"./HttpServiceError.js";import{BadRequestError as f}from"./BadRequestError.js";import{UnauthorizedError as n}from"./UnauthorizedError.js";import{ForbiddenError as i}from"./ForbiddenError.js";import{NotFoundError as b}from"./NotFoundError.js";import{MethodNotAllowedError as u}from"./MethodNotAllowedError.js";import{ConflictError as R}from"./ConflictError.js";import{PreconditionFailedError as c}from"./PreconditionFailedError.js";import{PayloadTooLargeError as S}from"./PayloadTooLargeError.js";import{UnsupportedMediaTypeError as h}from"./UnsupportedMediaTypeError.js";import{RateLimitedError as P}from"./RateLimitedError.js";import{InternalServerError as F,DefaultInternalServerError as I}from"./InternalServerError.js";import{NotImplementedError as U}from"./NotImplementedError.js";import{BadGatewayError as w}from"./BadGatewayError.js";import{ServiceUnavailableError as C}from"./ServiceUnavailableError.js";import{DatabaseError as G}from"./DatabaseError.js";import{NonRetryableError as g,OAuth2TokenNonRetryableError as q,OAuth2TokenRetryableError as z,OutcomeError as H,ProviderApiNonRetryableError as j,ProviderApiRetryableError as J,RetryableError as K}from"./OutcomeError.js";export{w as BadGatewayError,f as BadRequestError,e as CATALOG,R as ConflictError,G as DatabaseError,I as DefaultInternalServerError,i as ForbiddenError,E as HttpServiceError,F as InternalServerError,u as MethodNotAllowedError,g as NonRetryableError,b as NotFoundError,U as NotImplementedError,q as OAuth2TokenNonRetryableError,z as OAuth2TokenRetryableError,H as OutcomeError,S as PayloadTooLargeError,c as PreconditionFailedError,j as ProviderApiNonRetryableError,J as ProviderApiRetryableError,P as RateLimitedError,K as RetryableError,a as ServiceError,C as ServiceUnavailableError,n as UnauthorizedError,h as UnsupportedMediaTypeError};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { CATALOG } from './CATALOG.ts';\nexport type { HttpErrorDefinition, HttpErrorType } from './CATALOG.ts';\nexport { ServiceError } from './ServiceError.ts';\nexport type { ServiceErrorOptions, ErrorHttpPayload } from './ServiceError.ts';\nexport { HttpServiceError } from './HttpServiceError.ts';\nexport { BadRequestError } from './BadRequestError.ts';\nexport { UnauthorizedError } from './UnauthorizedError.ts';\nexport { ForbiddenError } from './ForbiddenError.ts';\nexport { NotFoundError } from './NotFoundError.ts';\nexport { MethodNotAllowedError } from './MethodNotAllowedError.ts';\nexport { ConflictError } from './ConflictError.ts';\nexport { PreconditionFailedError } from './PreconditionFailedError.ts';\nexport { PayloadTooLargeError } from './PayloadTooLargeError.ts';\nexport { UnsupportedMediaTypeError } from './UnsupportedMediaTypeError.ts';\nexport { RateLimitedError } from './RateLimitedError.ts';\nexport { InternalServerError, DefaultInternalServerError } from './InternalServerError.ts';\nexport { NotImplementedError } from './NotImplementedError.ts';\nexport { BadGatewayError } from './BadGatewayError.ts';\nexport { ServiceUnavailableError } from './ServiceUnavailableError.ts';\nexport { DatabaseError } from './DatabaseError.ts';\nexport {\n NonRetryableError,\n OAuth2TokenNonRetryableError,\n OAuth2TokenRetryableError,\n OutcomeError,\n ProviderApiNonRetryableError,\n ProviderApiRetryableError,\n RetryableError,\n} from './OutcomeError.ts';\nexport type { ErrorResponse } from './ErrorResponse.ts';\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe,eAExB,OAAS,gBAAAC,MAAoB,oBAE7B,OAAS,oBAAAC,MAAwB,wBACjC,OAAS,mBAAAC,MAAuB,uBAChC,OAAS,qBAAAC,MAAyB,yBAClC,OAAS,kBAAAC,MAAsB,sBAC/B,OAAS,iBAAAC,MAAqB,qBAC9B,OAAS,yBAAAC,MAA6B,6BACtC,OAAS,iBAAAC,MAAqB,qBAC9B,OAAS,2BAAAC,MAA+B,+BACxC,OAAS,wBAAAC,MAA4B,4BACrC,OAAS,6BAAAC,MAAiC,iCAC1C,OAAS,oBAAAC,MAAwB,wBACjC,OAAS,uBAAAC,EAAqB,8BAAAC,MAAkC,2BAChE,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,mBAAAC,MAAuB,uBAChC,OAAS,2BAAAC,MAA+B,+BACxC,OAAS,iBAAAC,MAAqB,qBAC9B,OACE,qBAAAC,EACA,gCAAAC,EACA,6BAAAC,EACA,gBAAAC,EACA,gCAAAC,EACA,6BAAAC,EACA,kBAAAC,MACK",
|
|
6
|
+
"names": ["CATALOG", "ServiceError", "HttpServiceError", "BadRequestError", "UnauthorizedError", "ForbiddenError", "NotFoundError", "MethodNotAllowedError", "ConflictError", "PreconditionFailedError", "PayloadTooLargeError", "UnsupportedMediaTypeError", "RateLimitedError", "InternalServerError", "DefaultInternalServerError", "NotImplementedError", "BadGatewayError", "ServiceUnavailableError", "DatabaseError", "NonRetryableError", "OAuth2TokenNonRetryableError", "OAuth2TokenRetryableError", "OutcomeError", "ProviderApiNonRetryableError", "ProviderApiRetryableError", "RetryableError"]
|
|
7
|
+
}
|