@rexezuge/errors 1.0.7 → 1.0.9
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.js +1 -1
- package/dist/BadGatewayError.js.map +1 -1
- package/dist/BadRequestError.d.ts +1 -1
- package/dist/BadRequestError.js +1 -1
- package/dist/BadRequestError.js.map +1 -1
- package/dist/CATALOG.d.ts +14 -14
- package/dist/CATALOG.js +15 -15
- package/dist/CATALOG.js.map +1 -1
- package/dist/ConflictError.d.ts +1 -1
- package/dist/ConflictError.js +1 -1
- package/dist/ConflictError.js.map +1 -1
- package/dist/ForbiddenError.d.ts +1 -1
- package/dist/ForbiddenError.js +1 -1
- package/dist/ForbiddenError.js.map +1 -1
- package/dist/HttpServiceError.d.ts +1 -1
- package/dist/HttpServiceError.js +1 -1
- package/dist/HttpServiceError.js.map +1 -1
- package/dist/InternalServerError.d.ts +1 -1
- package/dist/InternalServerError.js +1 -1
- package/dist/InternalServerError.js.map +1 -1
- package/dist/MethodNotAllowedError.d.ts +1 -1
- package/dist/MethodNotAllowedError.js +1 -1
- package/dist/MethodNotAllowedError.js.map +1 -1
- package/dist/NotFoundError.d.ts +1 -1
- package/dist/NotFoundError.js +1 -1
- package/dist/NotFoundError.js.map +1 -1
- package/dist/NotImplementedError.d.ts +1 -1
- package/dist/NotImplementedError.js +1 -1
- package/dist/NotImplementedError.js.map +1 -1
- package/dist/PayloadTooLargeError.d.ts +1 -1
- package/dist/PayloadTooLargeError.js +1 -1
- package/dist/PayloadTooLargeError.js.map +1 -1
- package/dist/PreconditionFailedError.d.ts +1 -1
- package/dist/PreconditionFailedError.js +1 -1
- package/dist/PreconditionFailedError.js.map +1 -1
- package/dist/RateLimitedError.d.ts +1 -1
- package/dist/RateLimitedError.js +1 -1
- package/dist/RateLimitedError.js.map +1 -1
- package/dist/ServiceUnavailableError.d.ts +1 -1
- package/dist/ServiceUnavailableError.js +1 -1
- package/dist/ServiceUnavailableError.js.map +1 -1
- package/dist/UnauthorizedError.d.ts +1 -1
- package/dist/UnauthorizedError.js +1 -1
- package/dist/UnauthorizedError.js.map +1 -1
- package/dist/UnsupportedMediaTypeError.d.ts +1 -1
- package/dist/UnsupportedMediaTypeError.js +1 -1
- package/dist/UnsupportedMediaTypeError.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
3
3
|
* 502 — an upstream dependency answered invalidly. Pair with `retryable: true`
|
|
4
4
|
* when the upstream is known to recover on its own.
|
|
5
5
|
*/
|
|
6
|
-
declare class BadGatewayError extends HttpServiceError<'
|
|
6
|
+
declare class BadGatewayError extends HttpServiceError<'BadGateway'> {
|
|
7
7
|
constructor(message?: string);
|
|
8
8
|
}
|
|
9
9
|
export { BadGatewayError };
|
package/dist/BadGatewayError.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadGatewayError.js","sourceRoot":"","sources":["../src/BadGatewayError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,eAAgB,SAAQ,gBAA8B;IAC1D,YAAY,OAAgB;QAC1B,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 502 — an upstream dependency answered invalidly. Pair with `retryable: true`\n * when the upstream is known to recover on its own.\n */\nclass BadGatewayError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"BadGatewayError.js","sourceRoot":"","sources":["../src/BadGatewayError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,eAAgB,SAAQ,gBAA8B;IAC1D,YAAY,OAAgB;QAC1B,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 502 — an upstream dependency answered invalidly. Pair with `retryable: true`\n * when the upstream is known to recover on its own.\n */\nclass BadGatewayError extends HttpServiceError<'BadGateway'> {\n constructor(message?: string) {\n super('BadGateway', message);\n }\n}\n\nexport { BadGatewayError };\n"]}
|
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 400 — malformed or missing input. Retrying without a change always fails.
|
|
4
4
|
*/
|
|
5
|
-
declare class BadRequestError extends HttpServiceError<'
|
|
5
|
+
declare class BadRequestError extends HttpServiceError<'BadRequest'> {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
export { BadRequestError };
|
package/dist/BadRequestError.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadRequestError.js","sourceRoot":"","sources":["../src/BadRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,eAAgB,SAAQ,gBAA8B;IAC1D,YAAY,OAAgB;QAC1B,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 400 — malformed or missing input. Retrying without a change always fails.\n */\nclass BadRequestError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"BadRequestError.js","sourceRoot":"","sources":["../src/BadRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,eAAgB,SAAQ,gBAA8B;IAC1D,YAAY,OAAgB;QAC1B,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 400 — malformed or missing input. Retrying without a change always fails.\n */\nclass BadRequestError extends HttpServiceError<'BadRequest'> {\n constructor(message?: string) {\n super('BadRequest', message);\n }\n}\n\nexport { BadRequestError };\n"]}
|
package/dist/CATALOG.d.ts
CHANGED
|
@@ -17,85 +17,85 @@ interface HttpErrorDefinition {
|
|
|
17
17
|
expose: boolean;
|
|
18
18
|
}
|
|
19
19
|
declare const CATALOG: {
|
|
20
|
-
readonly
|
|
20
|
+
readonly BadRequest: {
|
|
21
21
|
readonly status: 400;
|
|
22
22
|
readonly code: "BAD_REQUEST";
|
|
23
23
|
readonly defaultMessage: "The request could not be understood or was missing required parameters.";
|
|
24
24
|
readonly expose: true;
|
|
25
25
|
};
|
|
26
|
-
readonly
|
|
26
|
+
readonly Unauthorized: {
|
|
27
27
|
readonly status: 401;
|
|
28
28
|
readonly code: "UNAUTHORIZED";
|
|
29
29
|
readonly defaultMessage: "Authentication is required and has failed or has not yet been provided.";
|
|
30
30
|
readonly expose: true;
|
|
31
31
|
};
|
|
32
|
-
readonly
|
|
32
|
+
readonly Forbidden: {
|
|
33
33
|
readonly status: 403;
|
|
34
34
|
readonly code: "FORBIDDEN";
|
|
35
35
|
readonly defaultMessage: "You do not have permission to perform this action.";
|
|
36
36
|
readonly expose: true;
|
|
37
37
|
};
|
|
38
|
-
readonly
|
|
38
|
+
readonly NotFound: {
|
|
39
39
|
readonly status: 404;
|
|
40
40
|
readonly code: "NOT_FOUND";
|
|
41
41
|
readonly defaultMessage: "The requested resource was not found.";
|
|
42
42
|
readonly expose: true;
|
|
43
43
|
};
|
|
44
|
-
readonly
|
|
44
|
+
readonly MethodNotAllowed: {
|
|
45
45
|
readonly status: 405;
|
|
46
46
|
readonly code: "METHOD_NOT_ALLOWED";
|
|
47
47
|
readonly defaultMessage: "The requested method is not allowed for this resource.";
|
|
48
48
|
readonly expose: true;
|
|
49
49
|
};
|
|
50
|
-
readonly
|
|
50
|
+
readonly Conflict: {
|
|
51
51
|
readonly status: 409;
|
|
52
52
|
readonly code: "CONFLICT";
|
|
53
53
|
readonly defaultMessage: "The request conflicts with the current state of the resource.";
|
|
54
54
|
readonly expose: true;
|
|
55
55
|
};
|
|
56
|
-
readonly
|
|
56
|
+
readonly PreconditionFailed: {
|
|
57
57
|
readonly status: 412;
|
|
58
58
|
readonly code: "PRECONDITION_FAILED";
|
|
59
59
|
readonly defaultMessage: "A precondition for this request failed.";
|
|
60
60
|
readonly expose: true;
|
|
61
61
|
};
|
|
62
|
-
readonly
|
|
62
|
+
readonly PayloadTooLarge: {
|
|
63
63
|
readonly status: 413;
|
|
64
64
|
readonly code: "PAYLOAD_TOO_LARGE";
|
|
65
65
|
readonly defaultMessage: "The request payload is larger than the server is willing to process.";
|
|
66
66
|
readonly expose: true;
|
|
67
67
|
};
|
|
68
|
-
readonly
|
|
68
|
+
readonly UnsupportedMediaType: {
|
|
69
69
|
readonly status: 415;
|
|
70
70
|
readonly code: "UNSUPPORTED_MEDIA_TYPE";
|
|
71
71
|
readonly defaultMessage: "The request payload format is not supported by this resource.";
|
|
72
72
|
readonly expose: true;
|
|
73
73
|
};
|
|
74
|
-
readonly
|
|
74
|
+
readonly RateLimited: {
|
|
75
75
|
readonly status: 429;
|
|
76
76
|
readonly code: "RATE_LIMITED";
|
|
77
77
|
readonly defaultMessage: "Too many requests — slow down and retry later.";
|
|
78
78
|
readonly expose: true;
|
|
79
79
|
};
|
|
80
|
-
readonly
|
|
80
|
+
readonly InternalServerError: {
|
|
81
81
|
readonly status: 500;
|
|
82
82
|
readonly code: "INTERNAL_SERVER_ERROR";
|
|
83
83
|
readonly defaultMessage: "The server encountered an internal error and was unable to complete your request.";
|
|
84
84
|
readonly expose: false;
|
|
85
85
|
};
|
|
86
|
-
readonly
|
|
86
|
+
readonly NotImplemented: {
|
|
87
87
|
readonly status: 501;
|
|
88
88
|
readonly code: "NOT_IMPLEMENTED";
|
|
89
89
|
readonly defaultMessage: "The server does not support the functionality required to fulfil this request.";
|
|
90
90
|
readonly expose: false;
|
|
91
91
|
};
|
|
92
|
-
readonly
|
|
92
|
+
readonly BadGateway: {
|
|
93
93
|
readonly status: 502;
|
|
94
94
|
readonly code: "BAD_GATEWAY";
|
|
95
95
|
readonly defaultMessage: "The server received an invalid response from an upstream service.";
|
|
96
96
|
readonly expose: false;
|
|
97
97
|
};
|
|
98
|
-
readonly
|
|
98
|
+
readonly ServiceUnavailable: {
|
|
99
99
|
readonly status: 503;
|
|
100
100
|
readonly code: "SERVICE_UNAVAILABLE";
|
|
101
101
|
readonly defaultMessage: "The server is currently unable to handle the request — retry after a delay.";
|
package/dist/CATALOG.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
const CATALOG = {
|
|
2
|
-
|
|
2
|
+
BadRequest: {
|
|
3
3
|
status: 400,
|
|
4
4
|
code: 'BAD_REQUEST',
|
|
5
5
|
defaultMessage: 'The request could not be understood or was missing required parameters.',
|
|
6
6
|
expose: true,
|
|
7
7
|
},
|
|
8
|
-
|
|
8
|
+
Unauthorized: {
|
|
9
9
|
status: 401,
|
|
10
10
|
code: 'UNAUTHORIZED',
|
|
11
11
|
defaultMessage: 'Authentication is required and has failed or has not yet been provided.',
|
|
12
12
|
expose: true,
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
Forbidden: {
|
|
15
15
|
status: 403,
|
|
16
16
|
code: 'FORBIDDEN',
|
|
17
17
|
defaultMessage: 'You do not have permission to perform this action.',
|
|
18
18
|
expose: true,
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
NotFound: {
|
|
21
21
|
status: 404,
|
|
22
22
|
code: 'NOT_FOUND',
|
|
23
23
|
defaultMessage: 'The requested resource was not found.',
|
|
24
24
|
expose: true,
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
MethodNotAllowed: {
|
|
27
27
|
status: 405,
|
|
28
28
|
code: 'METHOD_NOT_ALLOWED',
|
|
29
29
|
defaultMessage: 'The requested method is not allowed for this resource.',
|
|
30
30
|
expose: true,
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
// Distinct from `
|
|
32
|
+
Conflict: {
|
|
33
|
+
// Distinct from `BadRequest` so callers can tell "invalid input" from
|
|
34
34
|
// "that value is taken" — the latter never succeeds without a change.
|
|
35
35
|
status: 409,
|
|
36
36
|
code: 'CONFLICT',
|
|
37
37
|
defaultMessage: 'The request conflicts with the current state of the resource.',
|
|
38
38
|
expose: true,
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
PreconditionFailed: {
|
|
41
41
|
status: 412,
|
|
42
42
|
code: 'PRECONDITION_FAILED',
|
|
43
43
|
defaultMessage: 'A precondition for this request failed.',
|
|
44
44
|
expose: true,
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
PayloadTooLarge: {
|
|
47
47
|
status: 413,
|
|
48
48
|
code: 'PAYLOAD_TOO_LARGE',
|
|
49
49
|
defaultMessage: 'The request payload is larger than the server is willing to process.',
|
|
50
50
|
expose: true,
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
UnsupportedMediaType: {
|
|
53
53
|
status: 415,
|
|
54
54
|
code: 'UNSUPPORTED_MEDIA_TYPE',
|
|
55
55
|
defaultMessage: 'The request payload format is not supported by this resource.',
|
|
56
56
|
expose: true,
|
|
57
57
|
},
|
|
58
|
-
|
|
58
|
+
RateLimited: {
|
|
59
59
|
status: 429,
|
|
60
60
|
code: 'RATE_LIMITED',
|
|
61
61
|
defaultMessage: 'Too many requests — slow down and retry later.',
|
|
62
62
|
expose: true,
|
|
63
63
|
},
|
|
64
|
-
|
|
64
|
+
InternalServerError: {
|
|
65
65
|
status: 500,
|
|
66
66
|
code: 'INTERNAL_SERVER_ERROR',
|
|
67
67
|
defaultMessage: 'The server encountered an internal error and was unable to complete your request.',
|
|
68
68
|
expose: false,
|
|
69
69
|
},
|
|
70
|
-
|
|
70
|
+
NotImplemented: {
|
|
71
71
|
status: 501,
|
|
72
72
|
code: 'NOT_IMPLEMENTED',
|
|
73
73
|
defaultMessage: 'The server does not support the functionality required to fulfil this request.',
|
|
@@ -75,13 +75,13 @@ const CATALOG = {
|
|
|
75
75
|
},
|
|
76
76
|
// Upstream dependency failures: 502 is the honest status here, and the
|
|
77
77
|
// retryable marker (not the status) is what schedules a retry.
|
|
78
|
-
|
|
78
|
+
BadGateway: {
|
|
79
79
|
status: 502,
|
|
80
80
|
code: 'BAD_GATEWAY',
|
|
81
81
|
defaultMessage: 'The server received an invalid response from an upstream service.',
|
|
82
82
|
expose: false,
|
|
83
83
|
},
|
|
84
|
-
|
|
84
|
+
ServiceUnavailable: {
|
|
85
85
|
status: 503,
|
|
86
86
|
code: 'SERVICE_UNAVAILABLE',
|
|
87
87
|
defaultMessage: 'The server is currently unable to handle the request — retry after a delay.',
|
package/dist/CATALOG.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CATALOG.js","sourceRoot":"","sources":["../src/CATALOG.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,GAAG;IACd,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,aAAa;QACnB,cAAc,EAAE,yEAAyE;QACzF,MAAM,EAAE,IAAI;KACb;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE,yEAAyE;QACzF,MAAM,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACT,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,oDAAoD;QACpE,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,uCAAuC;QACvD,MAAM,EAAE,IAAI;KACb;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,oBAAoB;QAC1B,cAAc,EAAE,wDAAwD;QACxE,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,sEAAsE;QACtE,sEAAsE;QACtE,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE,+DAA+D;QAC/E,MAAM,EAAE,IAAI;KACb;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,qBAAqB;QAC3B,cAAc,EAAE,yCAAyC;QACzD,MAAM,EAAE,IAAI;KACb;IACD,eAAe,EAAE;QACf,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,mBAAmB;QACzB,cAAc,EAAE,sEAAsE;QACtF,MAAM,EAAE,IAAI;KACb;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,wBAAwB;QAC9B,cAAc,EAAE,+DAA+D;QAC/E,MAAM,EAAE,IAAI;KACb;IACD,WAAW,EAAE;QACX,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE,gDAAgD;QAChE,MAAM,EAAE,IAAI;KACb;IACD,mBAAmB,EAAE;QACnB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,uBAAuB;QAC7B,cAAc,EAAE,mFAAmF;QACnG,MAAM,EAAE,KAAK;KACd;IACD,cAAc,EAAE;QACd,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,iBAAiB;QACvB,cAAc,EAAE,gFAAgF;QAChG,MAAM,EAAE,KAAK;KACd;IACD,uEAAuE;IACvE,+DAA+D;IAC/D,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,aAAa;QACnB,cAAc,EAAE,mEAAmE;QACnF,MAAM,EAAE,KAAK;KACd;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,qBAAqB;QAC3B,cAAc,EAAE,6EAA6E;QAC7F,MAAM,EAAE,IAAI;KACb;CACqD,CAAC;AAIzD,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/**\n * The single source of truth for HTTP-semantic errors.\n *\n * Eight repos carried this table as fourteen copy-pasted classes; the status,\n * machine code, and default message could drift per file. The catalog keeps all\n * three fields adjacent, so adding a status is one row, and a status can never\n * disagree with its code.\n *\n * `expose` marks whether the raw message may reach a client. Every 4xx is\n * trusted; every 5xx is not — a 5xx message is for operators, and\n * `toErrorResponse()` substitutes a generic one.\n */\ninterface HttpErrorDefinition {\n status: number;\n code: string;\n defaultMessage: string;\n expose: boolean;\n}\n\nconst CATALOG = {\n
|
|
1
|
+
{"version":3,"file":"CATALOG.js","sourceRoot":"","sources":["../src/CATALOG.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,GAAG;IACd,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,aAAa;QACnB,cAAc,EAAE,yEAAyE;QACzF,MAAM,EAAE,IAAI;KACb;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE,yEAAyE;QACzF,MAAM,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACT,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,oDAAoD;QACpE,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,uCAAuC;QACvD,MAAM,EAAE,IAAI;KACb;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,oBAAoB;QAC1B,cAAc,EAAE,wDAAwD;QACxE,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,sEAAsE;QACtE,sEAAsE;QACtE,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE,+DAA+D;QAC/E,MAAM,EAAE,IAAI;KACb;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,qBAAqB;QAC3B,cAAc,EAAE,yCAAyC;QACzD,MAAM,EAAE,IAAI;KACb;IACD,eAAe,EAAE;QACf,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,mBAAmB;QACzB,cAAc,EAAE,sEAAsE;QACtF,MAAM,EAAE,IAAI;KACb;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,wBAAwB;QAC9B,cAAc,EAAE,+DAA+D;QAC/E,MAAM,EAAE,IAAI;KACb;IACD,WAAW,EAAE;QACX,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE,gDAAgD;QAChE,MAAM,EAAE,IAAI;KACb;IACD,mBAAmB,EAAE;QACnB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,uBAAuB;QAC7B,cAAc,EAAE,mFAAmF;QACnG,MAAM,EAAE,KAAK;KACd;IACD,cAAc,EAAE;QACd,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,iBAAiB;QACvB,cAAc,EAAE,gFAAgF;QAChG,MAAM,EAAE,KAAK;KACd;IACD,uEAAuE;IACvE,+DAA+D;IAC/D,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,aAAa;QACnB,cAAc,EAAE,mEAAmE;QACnF,MAAM,EAAE,KAAK;KACd;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,qBAAqB;QAC3B,cAAc,EAAE,6EAA6E;QAC7F,MAAM,EAAE,IAAI;KACb;CACqD,CAAC;AAIzD,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/**\n * The single source of truth for HTTP-semantic errors.\n *\n * Eight repos carried this table as fourteen copy-pasted classes; the status,\n * machine code, and default message could drift per file. The catalog keeps all\n * three fields adjacent, so adding a status is one row, and a status can never\n * disagree with its code.\n *\n * `expose` marks whether the raw message may reach a client. Every 4xx is\n * trusted; every 5xx is not — a 5xx message is for operators, and\n * `toErrorResponse()` substitutes a generic one.\n */\ninterface HttpErrorDefinition {\n status: number;\n code: string;\n defaultMessage: string;\n expose: boolean;\n}\n\nconst CATALOG = {\n BadRequest: {\n status: 400,\n code: 'BAD_REQUEST',\n defaultMessage: 'The request could not be understood or was missing required parameters.',\n expose: true,\n },\n Unauthorized: {\n status: 401,\n code: 'UNAUTHORIZED',\n defaultMessage: 'Authentication is required and has failed or has not yet been provided.',\n expose: true,\n },\n Forbidden: {\n status: 403,\n code: 'FORBIDDEN',\n defaultMessage: 'You do not have permission to perform this action.',\n expose: true,\n },\n NotFound: {\n status: 404,\n code: 'NOT_FOUND',\n defaultMessage: 'The requested resource was not found.',\n expose: true,\n },\n MethodNotAllowed: {\n status: 405,\n code: 'METHOD_NOT_ALLOWED',\n defaultMessage: 'The requested method is not allowed for this resource.',\n expose: true,\n },\n Conflict: {\n // Distinct from `BadRequest` so callers can tell \"invalid input\" from\n // \"that value is taken\" — the latter never succeeds without a change.\n status: 409,\n code: 'CONFLICT',\n defaultMessage: 'The request conflicts with the current state of the resource.',\n expose: true,\n },\n PreconditionFailed: {\n status: 412,\n code: 'PRECONDITION_FAILED',\n defaultMessage: 'A precondition for this request failed.',\n expose: true,\n },\n PayloadTooLarge: {\n status: 413,\n code: 'PAYLOAD_TOO_LARGE',\n defaultMessage: 'The request payload is larger than the server is willing to process.',\n expose: true,\n },\n UnsupportedMediaType: {\n status: 415,\n code: 'UNSUPPORTED_MEDIA_TYPE',\n defaultMessage: 'The request payload format is not supported by this resource.',\n expose: true,\n },\n RateLimited: {\n status: 429,\n code: 'RATE_LIMITED',\n defaultMessage: 'Too many requests — slow down and retry later.',\n expose: true,\n },\n InternalServerError: {\n status: 500,\n code: 'INTERNAL_SERVER_ERROR',\n defaultMessage: 'The server encountered an internal error and was unable to complete your request.',\n expose: false,\n },\n NotImplemented: {\n status: 501,\n code: 'NOT_IMPLEMENTED',\n defaultMessage: 'The server does not support the functionality required to fulfil this request.',\n expose: false,\n },\n // Upstream dependency failures: 502 is the honest status here, and the\n // retryable marker (not the status) is what schedules a retry.\n BadGateway: {\n status: 502,\n code: 'BAD_GATEWAY',\n defaultMessage: 'The server received an invalid response from an upstream service.',\n expose: false,\n },\n ServiceUnavailable: {\n status: 503,\n code: 'SERVICE_UNAVAILABLE',\n defaultMessage: 'The server is currently unable to handle the request — retry after a delay.',\n expose: true,\n },\n} as const satisfies Record<string, HttpErrorDefinition>;\n\ntype HttpErrorType = keyof typeof CATALOG;\n\nexport { CATALOG };\nexport type { HttpErrorDefinition, HttpErrorType };\n"]}
|
package/dist/ConflictError.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
3
3
|
* 409 — well-formed but the resource state forbids it: a taken email, a
|
|
4
4
|
* duplicate name, a stale precondition. Not retryable without a change.
|
|
5
5
|
*/
|
|
6
|
-
declare class ConflictError extends HttpServiceError<'
|
|
6
|
+
declare class ConflictError extends HttpServiceError<'Conflict'> {
|
|
7
7
|
constructor(message?: string);
|
|
8
8
|
}
|
|
9
9
|
export { ConflictError };
|
package/dist/ConflictError.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConflictError.js","sourceRoot":"","sources":["../src/ConflictError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,aAAc,SAAQ,gBAA4B;IACtD,YAAY,OAAgB;QAC1B,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 409 — well-formed but the resource state forbids it: a taken email, a\n * duplicate name, a stale precondition. Not retryable without a change.\n */\nclass ConflictError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"ConflictError.js","sourceRoot":"","sources":["../src/ConflictError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,aAAc,SAAQ,gBAA4B;IACtD,YAAY,OAAgB;QAC1B,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 409 — well-formed but the resource state forbids it: a taken email, a\n * duplicate name, a stale precondition. Not retryable without a change.\n */\nclass ConflictError extends HttpServiceError<'Conflict'> {\n constructor(message?: string) {\n super('Conflict', message);\n }\n}\n\nexport { ConflictError };\n"]}
|
package/dist/ForbiddenError.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 403 — the caller is authenticated but the action is not theirs to take.
|
|
4
4
|
*/
|
|
5
|
-
declare class ForbiddenError extends HttpServiceError<'
|
|
5
|
+
declare class ForbiddenError extends HttpServiceError<'Forbidden'> {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
export { ForbiddenError };
|
package/dist/ForbiddenError.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForbiddenError.js","sourceRoot":"","sources":["../src/ForbiddenError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,cAAe,SAAQ,gBAA6B;IACxD,YAAY,OAAgB;QAC1B,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 403 — the caller is authenticated but the action is not theirs to take.\n */\nclass ForbiddenError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"ForbiddenError.js","sourceRoot":"","sources":["../src/ForbiddenError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,cAAe,SAAQ,gBAA6B;IACxD,YAAY,OAAgB;QAC1B,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 403 — the caller is authenticated but the action is not theirs to take.\n */\nclass ForbiddenError extends HttpServiceError<'Forbidden'> {\n constructor(message?: string) {\n super('Forbidden', message);\n }\n}\n\nexport { ForbiddenError };\n"]}
|
|
@@ -5,7 +5,7 @@ import type { ServiceErrorOptions } from './ServiceError';
|
|
|
5
5
|
* A `ServiceError` with a fixed HTTP status and type from the catalog.
|
|
6
6
|
*
|
|
7
7
|
* Concrete subclasses add nothing but a name, so they are one-liners:
|
|
8
|
-
* `class NotFoundError extends HttpServiceError<'
|
|
8
|
+
* `class NotFoundError extends HttpServiceError<'NotFound'> {}`.
|
|
9
9
|
*/
|
|
10
10
|
declare abstract class HttpServiceError<TType extends HttpErrorType> extends ServiceError {
|
|
11
11
|
constructor(errorType: TType, message?: string, options?: ServiceErrorOptions);
|
package/dist/HttpServiceError.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ServiceError } from './ServiceError';
|
|
|
4
4
|
* A `ServiceError` with a fixed HTTP status and type from the catalog.
|
|
5
5
|
*
|
|
6
6
|
* Concrete subclasses add nothing but a name, so they are one-liners:
|
|
7
|
-
* `class NotFoundError extends HttpServiceError<'
|
|
7
|
+
* `class NotFoundError extends HttpServiceError<'NotFound'> {}`.
|
|
8
8
|
*/
|
|
9
9
|
class HttpServiceError extends ServiceError {
|
|
10
10
|
constructor(errorType, message, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpServiceError.js","sourceRoot":"","sources":["../src/HttpServiceError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;GAKG;AACH,MAAe,gBAA8C,SAAQ,YAAY;IAC/E,YAAY,SAAgB,EAAE,OAAgB,EAAE,OAA6B;QAC3E,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,IAAI,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { CATALOG } from './CATALOG';\nimport type { HttpErrorType } from './CATALOG';\nimport { ServiceError } from './ServiceError';\nimport type { ServiceErrorOptions } from './ServiceError';\n\n/**\n * A `ServiceError` with a fixed HTTP status and type from the catalog.\n *\n * Concrete subclasses add nothing but a name, so they are one-liners:\n * `class NotFoundError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"HttpServiceError.js","sourceRoot":"","sources":["../src/HttpServiceError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;GAKG;AACH,MAAe,gBAA8C,SAAQ,YAAY;IAC/E,YAAY,SAAgB,EAAE,OAAgB,EAAE,OAA6B;QAC3E,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,IAAI,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { CATALOG } from './CATALOG';\nimport type { HttpErrorType } from './CATALOG';\nimport { ServiceError } from './ServiceError';\nimport type { ServiceErrorOptions } from './ServiceError';\n\n/**\n * A `ServiceError` with a fixed HTTP status and type from the catalog.\n *\n * Concrete subclasses add nothing but a name, so they are one-liners:\n * `class NotFoundError extends HttpServiceError<'NotFound'> {}`.\n */\nabstract class HttpServiceError<TType extends HttpErrorType> extends ServiceError {\n constructor(errorType: TType, message?: string, options?: ServiceErrorOptions) {\n const definition = CATALOG[errorType];\n super(definition.status, errorType, message ?? definition.defaultMessage, options);\n }\n}\n\nexport { HttpServiceError };\n"]}
|
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 500 — the catch-all server fault.
|
|
4
4
|
*/
|
|
5
|
-
declare class InternalServerError extends HttpServiceError<'
|
|
5
|
+
declare class InternalServerError extends HttpServiceError<'InternalServerError'> {
|
|
6
6
|
constructor(message?: string, options?: {
|
|
7
7
|
cause?: unknown;
|
|
8
8
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalServerError.js","sourceRoot":"","sources":["../src/InternalServerError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,mBAAoB,SAAQ,gBAAuC;IACvE,YAAY,OAAgB,EAAE,OAA6B;QACzD,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,0BAA0B,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 500 — the catch-all server fault.\n */\nclass InternalServerError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"InternalServerError.js","sourceRoot":"","sources":["../src/InternalServerError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,mBAAoB,SAAQ,gBAAuC;IACvE,YAAY,OAAgB,EAAE,OAA6B;QACzD,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,0BAA0B,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 500 — the catch-all server fault.\n */\nclass InternalServerError extends HttpServiceError<'InternalServerError'> {\n constructor(message?: string, options?: { cause?: unknown }) {\n super('InternalServerError', message, options);\n }\n}\n\n/**\n * The instance returned to callers when the real cause must not be disclosed:\n * same stable type, generic message, regardless of what failed.\n */\nconst DefaultInternalServerError = new InternalServerError();\n\nexport { InternalServerError, DefaultInternalServerError };\n"]}
|
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 405 — the method exists but not on this path.
|
|
4
4
|
*/
|
|
5
|
-
declare class MethodNotAllowedError extends HttpServiceError<'
|
|
5
|
+
declare class MethodNotAllowedError extends HttpServiceError<'MethodNotAllowed'> {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
export { MethodNotAllowedError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MethodNotAllowedError.js","sourceRoot":"","sources":["../src/MethodNotAllowedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,qBAAsB,SAAQ,gBAAoC;IACtE,YAAY,OAAgB;QAC1B,KAAK,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 405 — the method exists but not on this path.\n */\nclass MethodNotAllowedError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"MethodNotAllowedError.js","sourceRoot":"","sources":["../src/MethodNotAllowedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,qBAAsB,SAAQ,gBAAoC;IACtE,YAAY,OAAgB;QAC1B,KAAK,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 405 — the method exists but not on this path.\n */\nclass MethodNotAllowedError extends HttpServiceError<'MethodNotAllowed'> {\n constructor(message?: string) {\n super('MethodNotAllowed', message);\n }\n}\n\nexport { MethodNotAllowedError };\n"]}
|
package/dist/NotFoundError.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 404 — no such resource.
|
|
4
4
|
*/
|
|
5
|
-
declare class NotFoundError extends HttpServiceError<'
|
|
5
|
+
declare class NotFoundError extends HttpServiceError<'NotFound'> {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
export { NotFoundError };
|
package/dist/NotFoundError.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotFoundError.js","sourceRoot":"","sources":["../src/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,aAAc,SAAQ,gBAA4B;IACtD,YAAY,OAAgB;QAC1B,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 404 — no such resource.\n */\nclass NotFoundError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"NotFoundError.js","sourceRoot":"","sources":["../src/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,aAAc,SAAQ,gBAA4B;IACtD,YAAY,OAAgB;QAC1B,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 404 — no such resource.\n */\nclass NotFoundError extends HttpServiceError<'NotFound'> {\n constructor(message?: string) {\n super('NotFound', message);\n }\n}\n\nexport { NotFoundError };\n"]}
|
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 501 — the functionality exists in the protocol but not on this deployment.
|
|
4
4
|
*/
|
|
5
|
-
declare class NotImplementedError extends HttpServiceError<'
|
|
5
|
+
declare class NotImplementedError extends HttpServiceError<'NotImplemented'> {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
export { NotImplementedError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotImplementedError.js","sourceRoot":"","sources":["../src/NotImplementedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,mBAAoB,SAAQ,gBAAkC;IAClE,YAAY,OAAgB;QAC1B,KAAK,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;CACF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 501 — the functionality exists in the protocol but not on this deployment.\n */\nclass NotImplementedError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"NotImplementedError.js","sourceRoot":"","sources":["../src/NotImplementedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,mBAAoB,SAAQ,gBAAkC;IAClE,YAAY,OAAgB;QAC1B,KAAK,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;CACF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 501 — the functionality exists in the protocol but not on this deployment.\n */\nclass NotImplementedError extends HttpServiceError<'NotImplemented'> {\n constructor(message?: string) {\n super('NotImplemented', message);\n }\n}\n\nexport { NotImplementedError };\n"]}
|
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 413 — the payload exceeds the server's limits (request body, file, batch).
|
|
4
4
|
*/
|
|
5
|
-
declare class PayloadTooLargeError extends HttpServiceError<'
|
|
5
|
+
declare class PayloadTooLargeError extends HttpServiceError<'PayloadTooLarge'> {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
export { PayloadTooLargeError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadTooLargeError.js","sourceRoot":"","sources":["../src/PayloadTooLargeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,oBAAqB,SAAQ,gBAAmC;IACpE,YAAY,OAAgB;QAC1B,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;CACF;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 413 — the payload exceeds the server's limits (request body, file, batch).\n */\nclass PayloadTooLargeError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"PayloadTooLargeError.js","sourceRoot":"","sources":["../src/PayloadTooLargeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,oBAAqB,SAAQ,gBAAmC;IACpE,YAAY,OAAgB;QAC1B,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;CACF;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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"]}
|
|
@@ -3,7 +3,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
3
3
|
* 412 — a precondition the caller supplied (e.g. `If-Match`, expected state)
|
|
4
4
|
* did not hold. Retrying unmodified fails by definition.
|
|
5
5
|
*/
|
|
6
|
-
declare class PreconditionFailedError extends HttpServiceError<'
|
|
6
|
+
declare class PreconditionFailedError extends HttpServiceError<'PreconditionFailed'> {
|
|
7
7
|
constructor(message?: string);
|
|
8
8
|
}
|
|
9
9
|
export { PreconditionFailedError };
|
|
@@ -5,7 +5,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
5
5
|
*/
|
|
6
6
|
class PreconditionFailedError extends HttpServiceError {
|
|
7
7
|
constructor(message) {
|
|
8
|
-
super('
|
|
8
|
+
super('PreconditionFailed', message);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export { PreconditionFailedError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreconditionFailedError.js","sourceRoot":"","sources":["../src/PreconditionFailedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,uBAAwB,SAAQ,gBAAsC;IAC1E,YAAY,OAAgB;QAC1B,KAAK,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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<'
|
|
1
|
+
{"version":3,"file":"PreconditionFailedError.js","sourceRoot":"","sources":["../src/PreconditionFailedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,uBAAwB,SAAQ,gBAAsC;IAC1E,YAAY,OAAgB;QAC1B,KAAK,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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"]}
|
|
@@ -3,7 +3,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
3
3
|
* 429 — the caller exceeded its rate budget. Retrying is not just futile but
|
|
4
4
|
* punished; honor `retryAfter`-style backoff at the caller.
|
|
5
5
|
*/
|
|
6
|
-
declare class RateLimitedError extends HttpServiceError<'
|
|
6
|
+
declare class RateLimitedError extends HttpServiceError<'RateLimited'> {
|
|
7
7
|
constructor(message?: string);
|
|
8
8
|
}
|
|
9
9
|
export { RateLimitedError };
|
package/dist/RateLimitedError.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RateLimitedError.js","sourceRoot":"","sources":["../src/RateLimitedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,gBAAiB,SAAQ,gBAA+B;IAC5D,YAAY,OAAgB;QAC1B,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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<'
|
|
1
|
+
{"version":3,"file":"RateLimitedError.js","sourceRoot":"","sources":["../src/RateLimitedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,gBAAiB,SAAQ,gBAA+B;IAC5D,YAAY,OAAgB;QAC1B,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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"]}
|
|
@@ -3,7 +3,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
3
3
|
* 503 — unavailable now, healthy later. The natural status for retryable
|
|
4
4
|
* infrastructure failures (a locked D1, an overloaded upstream).
|
|
5
5
|
*/
|
|
6
|
-
declare class ServiceUnavailableError extends HttpServiceError<'
|
|
6
|
+
declare class ServiceUnavailableError extends HttpServiceError<'ServiceUnavailable'> {
|
|
7
7
|
constructor(message?: string);
|
|
8
8
|
}
|
|
9
9
|
export { ServiceUnavailableError };
|
|
@@ -5,7 +5,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
5
5
|
*/
|
|
6
6
|
class ServiceUnavailableError extends HttpServiceError {
|
|
7
7
|
constructor(message) {
|
|
8
|
-
super('
|
|
8
|
+
super('ServiceUnavailable', message);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
export { ServiceUnavailableError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceUnavailableError.js","sourceRoot":"","sources":["../src/ServiceUnavailableError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,uBAAwB,SAAQ,gBAAsC;IAC1E,YAAY,OAAgB;QAC1B,KAAK,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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<'
|
|
1
|
+
{"version":3,"file":"ServiceUnavailableError.js","sourceRoot":"","sources":["../src/ServiceUnavailableError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,uBAAwB,SAAQ,gBAAsC;IAC1E,YAAY,OAAgB;QAC1B,KAAK,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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"]}
|
|
@@ -3,7 +3,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
3
3
|
* 401 — credentials missing, expired, or rejected. Distinct from `Forbidden`:
|
|
4
4
|
* re-authenticating may help; `Forbidden` it will not.
|
|
5
5
|
*/
|
|
6
|
-
declare class UnauthorizedError extends HttpServiceError<'
|
|
6
|
+
declare class UnauthorizedError extends HttpServiceError<'Unauthorized'> {
|
|
7
7
|
constructor(message?: string);
|
|
8
8
|
}
|
|
9
9
|
export { UnauthorizedError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnauthorizedError.js","sourceRoot":"","sources":["../src/UnauthorizedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,iBAAkB,SAAQ,gBAAgC;IAC9D,YAAY,OAAgB;QAC1B,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;CACF;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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<'
|
|
1
|
+
{"version":3,"file":"UnauthorizedError.js","sourceRoot":"","sources":["../src/UnauthorizedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,iBAAkB,SAAQ,gBAAgC;IAC9D,YAAY,OAAgB;QAC1B,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;CACF;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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"]}
|
|
@@ -2,7 +2,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
2
2
|
/**
|
|
3
3
|
* 415 — the body's content type is not one the endpoint can parse.
|
|
4
4
|
*/
|
|
5
|
-
declare class UnsupportedMediaTypeError extends HttpServiceError<'
|
|
5
|
+
declare class UnsupportedMediaTypeError extends HttpServiceError<'UnsupportedMediaType'> {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
export { UnsupportedMediaTypeError };
|
|
@@ -4,7 +4,7 @@ import { HttpServiceError } from './HttpServiceError';
|
|
|
4
4
|
*/
|
|
5
5
|
class UnsupportedMediaTypeError extends HttpServiceError {
|
|
6
6
|
constructor(message) {
|
|
7
|
-
super('
|
|
7
|
+
super('UnsupportedMediaType', message);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export { UnsupportedMediaTypeError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnsupportedMediaTypeError.js","sourceRoot":"","sources":["../src/UnsupportedMediaTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,yBAA0B,SAAQ,gBAAwC;IAC9E,YAAY,OAAgB;QAC1B,KAAK,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 415 — the body's content type is not one the endpoint can parse.\n */\nclass UnsupportedMediaTypeError extends HttpServiceError<'
|
|
1
|
+
{"version":3,"file":"UnsupportedMediaTypeError.js","sourceRoot":"","sources":["../src/UnsupportedMediaTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,yBAA0B,SAAQ,gBAAwC;IAC9E,YAAY,OAAgB;QAC1B,KAAK,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\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"]}
|