@webpieces/core-util 0.4.750 → 0.4.751
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/README.md +6 -0
- package/package.json +9 -1
- package/src/errors/ApiError.d.ts +70 -0
- package/src/errors/ApiError.js +106 -0
- package/src/errors/ApiError.js.map +1 -0
- package/src/errors/ApiErrorCodec.d.ts +25 -0
- package/src/errors/ApiErrorCodec.js +184 -0
- package/src/errors/ApiErrorCodec.js.map +1 -0
- package/src/errors/index.d.ts +2 -0
- package/src/errors/index.js +23 -0
- package/src/errors/index.js.map +1 -0
- package/src/http/HttpErrorStatus.d.ts +5 -0
- package/src/http/HttpErrorStatus.js +38 -0
- package/src/http/HttpErrorStatus.js.map +1 -0
- package/src/http/LogApiCall.d.ts +1 -1
- package/src/http/LogApiCall.js +7 -2
- package/src/http/LogApiCall.js.map +1 -1
- package/src/http/WebpiecesDefaultFailureClassifier.d.ts +4 -4
- package/src/http/WebpiecesDefaultFailureClassifier.js +11 -11
- package/src/http/WebpiecesDefaultFailureClassifier.js.map +1 -1
- package/src/http/decorators.d.ts +1 -1
- package/src/http/decorators.js +1 -1
- package/src/http/decorators.js.map +1 -1
- package/src/http/errors.d.ts +35 -158
- package/src/http/errors.js +65 -235
- package/src/http/errors.js.map +1 -1
- package/src/index.d.ts +8 -6
- package/src/index.js +20 -2
- package/src/index.js.map +1 -1
- package/src/ipc/IpcCompileAssertions.d.ts +4 -0
- package/src/ipc/IpcCompileAssertions.js +39 -0
- package/src/ipc/IpcCompileAssertions.js.map +1 -0
- package/src/ipc/IpcConnection.d.ts +50 -0
- package/src/ipc/IpcConnection.js +187 -0
- package/src/ipc/IpcConnection.js.map +1 -0
- package/src/ipc/IpcContract.d.ts +32 -0
- package/src/ipc/IpcContract.js +65 -0
- package/src/ipc/IpcContract.js.map +1 -0
- package/src/ipc/IpcLogging.d.ts +11 -0
- package/src/ipc/IpcLogging.js +13 -0
- package/src/ipc/IpcLogging.js.map +1 -0
- package/src/ipc/IpcProtocol.d.ts +37 -0
- package/src/ipc/IpcProtocol.js +103 -0
- package/src/ipc/IpcProtocol.js.map +1 -0
- package/src/ipc/index.d.ts +14 -0
- package/src/ipc/index.js +31 -0
- package/src/ipc/index.js.map +1 -0
package/src/http/errors.d.ts
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* HTTP Error classes for webpieces-ts.
|
|
3
|
-
* These errors are used throughout the framework for consistent error handling.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* ProtocolError - Data class for error response body.
|
|
7
|
-
* This is what gets serialized and sent to the client.
|
|
8
|
-
*
|
|
9
|
-
* EVERY field here is caller-facing, so the framework fills it CONSERVATIVELY. `HttpErrorWireMapper`
|
|
10
|
-
* (http-server) copies `message` from the thrown error for {@link HttpUserError} ONLY — the one type
|
|
11
|
-
* whose message is written for a human to read — and sends the generic HTTP reason phrase for every
|
|
12
|
-
* other type, because `Error.message` is an operator-facing field that routinely quotes downstream
|
|
13
|
-
* urls, response bodies and internal ids. `name` is not filled by that ladder at all.
|
|
14
|
-
*
|
|
15
|
-
* An app that wants to publish more than that does it deliberately, by installing an
|
|
16
|
-
* {@link ErrorTranslators} on {@link ClientRegistry}, whose `toWire()` response is sent verbatim.
|
|
17
|
-
*/
|
|
1
|
+
import { ApiError } from '../errors/ApiError';
|
|
18
2
|
export declare class ProtocolError {
|
|
19
3
|
message?: string;
|
|
20
4
|
subType?: string;
|
|
@@ -28,16 +12,6 @@ export declare class ProtocolError {
|
|
|
28
12
|
guiAlertMessage?: string;
|
|
29
13
|
errorCode?: string;
|
|
30
14
|
}
|
|
31
|
-
/**
|
|
32
|
-
* HttpError - Base error class with HTTP status code.
|
|
33
|
-
* All specific HTTP errors extend this class.
|
|
34
|
-
*/
|
|
35
|
-
export declare class HttpError extends Error {
|
|
36
|
-
code: number;
|
|
37
|
-
subType?: string;
|
|
38
|
-
readonly httpCause?: Error;
|
|
39
|
-
constructor(message: string, code: number, subType?: string, cause?: Error);
|
|
40
|
-
}
|
|
41
15
|
export declare const ENTITY_NOT_FOUND = "EntityNotFoundError";
|
|
42
16
|
export declare const WRONG_LOGIN_TYPE = "wrongLoginType";
|
|
43
17
|
export declare const WRONG_LOGIN = "wronglogin";
|
|
@@ -46,134 +20,37 @@ export declare const EMAIL_NOT_CONFIRMED = "email_not_confirmed";
|
|
|
46
20
|
export declare const WRONG_DOMAIN = "wrongdomain";
|
|
47
21
|
export declare const WRONG_COMPANY = "wrongcompany";
|
|
48
22
|
export declare const NO_REG_CODE = "noregcode";
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export
|
|
83
|
-
constructor(message: string, cause?: Error);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* HttpForbiddenError - 403 Forbidden.
|
|
87
|
-
*/
|
|
88
|
-
export declare class HttpForbiddenError extends HttpError {
|
|
89
|
-
constructor(message: string, cause?: Error);
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* HttpTimeoutError - 408 Request Timeout.
|
|
93
|
-
*/
|
|
94
|
-
export declare class HttpTimeoutError extends HttpError {
|
|
95
|
-
constructor(message: string, cause?: Error);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* HttpBadGatewayError - 502 Bad Gateway.
|
|
99
|
-
*/
|
|
100
|
-
export declare class HttpBadGatewayError extends HttpError {
|
|
101
|
-
constructor(message: string, cause?: Error);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* HttpServiceUnavailableError - 503 Service Unavailable.
|
|
105
|
-
*
|
|
106
|
-
* The cold-start code: a scale-to-zero backend (Cloud Run `min_instance_count = 0`) whose instance
|
|
107
|
-
* is still booting is answered by the load balancer with a 503 and ITS OWN HTML page — no
|
|
108
|
-
* ProtocolError body at all. Without this member the client fell through to a generic `HttpError`,
|
|
109
|
-
* so an app could not say "the server is waking, retry" without matching on `err.code === 503`,
|
|
110
|
-
* which is the untyped pattern this ladder exists to replace.
|
|
111
|
-
*/
|
|
112
|
-
export declare class HttpServiceUnavailableError extends HttpError {
|
|
113
|
-
constructor(message: string, cause?: Error);
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* HttpGatewayTimeoutError - 504 Gateway Timeout.
|
|
117
|
-
* SHOULD NOT BE USED SERVER SIDE SINCE ALBs will return 504 and it will not be translated
|
|
118
|
-
* to json body 'ProtocolError'.
|
|
119
|
-
*/
|
|
120
|
-
export declare class HttpGatewayTimeoutError extends HttpError {
|
|
121
|
-
constructor(message: string, cause?: Error);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* HttpInternalServerError - 500 Internal Server Error.
|
|
125
|
-
*/
|
|
126
|
-
export declare class HttpInternalServerError extends HttpError {
|
|
127
|
-
constructor(message: string, cause?: Error);
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* HttpVendorError - 598 Vendor Error.
|
|
131
|
-
* Custom status code for vendor/external service errors with retry hint.
|
|
132
|
-
*/
|
|
133
|
-
export declare class HttpVendorError extends HttpError {
|
|
134
|
-
waitSeconds: number;
|
|
135
|
-
constructor(message: string, waitSeconds?: number, cause?: Error);
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* HttpUserError - User validation error with 2xx status code.
|
|
139
|
-
*
|
|
140
|
-
* Uses HTTP 266 (non-standard 2xx code) intentionally because:
|
|
141
|
-
* 1. User validation errors are "successful" from server perspective - user just made a mistake
|
|
142
|
-
* 2. Browser DevTools show 4xx/5xx codes in RED, which is confusing for user validation
|
|
143
|
-
* 3. Allows error to propagate up the stack via throw without triggering error monitoring
|
|
144
|
-
* 4. Avoids polluting logs with "errors" that are actually expected user behavior
|
|
145
|
-
*
|
|
146
|
-
* This is a deliberate design pattern - do NOT change to 4xx codes.
|
|
147
|
-
* Examples: "Email already exists", "Invalid password format", "Required field missing"
|
|
148
|
-
*
|
|
149
|
-
* # It is also the ONLY type whose `message` reaches the caller
|
|
150
|
-
*
|
|
151
|
-
* `HttpErrorWireMapper` (http-server) copies `message` onto the response body for this type and no
|
|
152
|
-
* other; every other subclass sends the generic HTTP reason phrase for its status. That is not an
|
|
153
|
-
* arbitrary exception — it follows from the four points above. This type MEANS "this text was written
|
|
154
|
-
* for a human to read", where `Error.message` everywhere else means "this text was written for whoever
|
|
155
|
-
* reads the logs" and routinely quotes downstream urls, response bodies and internal ids.
|
|
156
|
-
*
|
|
157
|
-
* So: text the user must SEE goes in an `HttpUserError` (or in `HttpBadRequestError.guiMessage`,
|
|
158
|
-
* which is the same idea one field down). Throwing `new HttpForbiddenError('you need the admin role
|
|
159
|
-
* on tenant 4471')` shows the user 'Forbidden' and nothing else.
|
|
160
|
-
*/
|
|
161
|
-
export declare class HttpUserError extends HttpError {
|
|
162
|
-
errorCode?: string;
|
|
163
|
-
constructor(message: string, errorCode?: string, cause?: Error);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* OfflineError - the request never reached a server.
|
|
167
|
-
*
|
|
168
|
-
* Offline, DNS failure, connection refused, CORS preflight rejected: `fetch` itself rejected, so no
|
|
169
|
-
* Response — and therefore no HTTP status — ever existed. That is precisely why this extends `Error`
|
|
170
|
-
* and NOT `HttpError`: an `HttpError` carries a `code` and means "the server replied with a failure",
|
|
171
|
-
* a different situation a caller usually retries differently. Subclassing it would give this a bogus
|
|
172
|
-
* status and make it match `instanceof HttpError` ladders that must not catch a transport reject.
|
|
173
|
-
*
|
|
174
|
-
* The original failure (a raw `TypeError: Failed to fetch`, or undici's coded reject) is always
|
|
175
|
-
* preserved as `cause`, so a caller that wants the underlying detail can still reach it.
|
|
176
|
-
*/
|
|
177
|
-
export declare class OfflineError extends Error {
|
|
178
|
-
constructor(message: string, cause?: Error);
|
|
179
|
-
}
|
|
23
|
+
/** @deprecated Prefer ApiError semantic subclasses; custom HTTP status belongs in ErrorTranslators. */
|
|
24
|
+
export declare class HttpError extends ApiError {
|
|
25
|
+
code: number;
|
|
26
|
+
constructor(message: string, code: number, subType?: string, cause?: Error);
|
|
27
|
+
/** @deprecated Use the standard Error.cause. */
|
|
28
|
+
get httpCause(): Error | undefined;
|
|
29
|
+
}
|
|
30
|
+
export { EndpointNotFoundError, OfflineError } from '../errors/ApiError';
|
|
31
|
+
/** @deprecated Use NotFoundError from @webpieces/core-util/errors. Same constructor identity. */
|
|
32
|
+
export { NotFoundError as HttpNotFoundError } from '../errors/ApiError';
|
|
33
|
+
/** @deprecated Use BadRequestError from @webpieces/core-util/errors. Same constructor identity. */
|
|
34
|
+
export { BadRequestError as HttpBadRequestError } from '../errors/ApiError';
|
|
35
|
+
/** @deprecated Use UnauthorizedError from @webpieces/core-util/errors. Same constructor identity. */
|
|
36
|
+
export { UnauthorizedError as HttpUnauthorizedError } from '../errors/ApiError';
|
|
37
|
+
/** @deprecated Use TooManyRequestsError from @webpieces/core-util/errors. Same constructor identity. */
|
|
38
|
+
export { TooManyRequestsError as HttpTooManyRequestsError } from '../errors/ApiError';
|
|
39
|
+
/** @deprecated Use ForbiddenError from @webpieces/core-util/errors. Same constructor identity. */
|
|
40
|
+
export { ForbiddenError as HttpForbiddenError } from '../errors/ApiError';
|
|
41
|
+
/** @deprecated Use RequestTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
|
|
42
|
+
export { RequestTimeoutError as HttpTimeoutError } from '../errors/ApiError';
|
|
43
|
+
/** @deprecated Use BadGatewayError from @webpieces/core-util/errors. Same constructor identity. */
|
|
44
|
+
export { BadGatewayError as HttpBadGatewayError } from '../errors/ApiError';
|
|
45
|
+
/** @deprecated Use ServiceUnavailableError from @webpieces/core-util/errors. Same constructor identity. */
|
|
46
|
+
export { ServiceUnavailableError as HttpServiceUnavailableError } from '../errors/ApiError';
|
|
47
|
+
/** @deprecated Use GatewayTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
|
|
48
|
+
export { GatewayTimeoutError as HttpGatewayTimeoutError } from '../errors/ApiError';
|
|
49
|
+
/** @deprecated Use InternalError from @webpieces/core-util/errors. Same constructor identity. */
|
|
50
|
+
export { InternalError as HttpInternalServerError } from '../errors/ApiError';
|
|
51
|
+
/** @deprecated Use VendorError from @webpieces/core-util/errors. Same constructor identity. */
|
|
52
|
+
export { VendorError as HttpVendorError } from '../errors/ApiError';
|
|
53
|
+
/** @deprecated Use UserError from @webpieces/core-util/errors. Same constructor identity. */
|
|
54
|
+
export { UserError as HttpUserError } from '../errors/ApiError';
|
|
55
|
+
export { NotFoundError, BadGatewayError, ServiceUnavailableError, GatewayTimeoutError, InternalError, TooManyRequestsError, ForbiddenError, RequestTimeoutError, UserError, BadRequestError, UnauthorizedError, VendorError, } from '../errors/ApiError';
|
|
56
|
+
export { ApiError };
|
package/src/http/errors.js
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* HTTP Error classes for webpieces-ts.
|
|
4
|
-
* These errors are used throughout the framework for consistent error handling.
|
|
5
|
-
*/
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* This is what gets serialized and sent to the client.
|
|
11
|
-
*
|
|
12
|
-
* EVERY field here is caller-facing, so the framework fills it CONSERVATIVELY. `HttpErrorWireMapper`
|
|
13
|
-
* (http-server) copies `message` from the thrown error for {@link HttpUserError} ONLY — the one type
|
|
14
|
-
* whose message is written for a human to read — and sends the generic HTTP reason phrase for every
|
|
15
|
-
* other type, because `Error.message` is an operator-facing field that routinely quotes downstream
|
|
16
|
-
* urls, response bodies and internal ids. `name` is not filled by that ladder at all.
|
|
17
|
-
*
|
|
18
|
-
* An app that wants to publish more than that does it deliberately, by installing an
|
|
19
|
-
* {@link ErrorTranslators} on {@link ClientRegistry}, whose `toWire()` response is sent verbatim.
|
|
20
|
-
*/
|
|
3
|
+
exports.ApiError = exports.VendorError = exports.UnauthorizedError = exports.BadRequestError = exports.UserError = exports.RequestTimeoutError = exports.ForbiddenError = exports.TooManyRequestsError = exports.InternalError = exports.GatewayTimeoutError = exports.ServiceUnavailableError = exports.BadGatewayError = exports.NotFoundError = exports.HttpUserError = exports.HttpVendorError = exports.HttpInternalServerError = exports.HttpGatewayTimeoutError = exports.HttpServiceUnavailableError = exports.HttpBadGatewayError = exports.HttpTimeoutError = exports.HttpForbiddenError = exports.HttpTooManyRequestsError = exports.HttpUnauthorizedError = exports.HttpBadRequestError = exports.HttpNotFoundError = exports.OfflineError = exports.EndpointNotFoundError = exports.HttpError = exports.NO_REG_CODE = exports.WRONG_COMPANY = exports.WRONG_DOMAIN = exports.EMAIL_NOT_CONFIRMED = exports.NOT_APPROVED = exports.WRONG_LOGIN = exports.WRONG_LOGIN_TYPE = exports.ENTITY_NOT_FOUND = exports.ProtocolError = void 0;
|
|
4
|
+
const ApiError_1 = require("../errors/ApiError");
|
|
5
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return ApiError_1.ApiError; } });
|
|
21
6
|
class ProtocolError {
|
|
22
7
|
message;
|
|
23
8
|
subType;
|
|
@@ -32,22 +17,6 @@ class ProtocolError {
|
|
|
32
17
|
errorCode;
|
|
33
18
|
}
|
|
34
19
|
exports.ProtocolError = ProtocolError;
|
|
35
|
-
/**
|
|
36
|
-
* HttpError - Base error class with HTTP status code.
|
|
37
|
-
* All specific HTTP errors extend this class.
|
|
38
|
-
*/
|
|
39
|
-
class HttpError extends Error {
|
|
40
|
-
code;
|
|
41
|
-
subType;
|
|
42
|
-
httpCause;
|
|
43
|
-
constructor(message, code, subType, cause) {
|
|
44
|
-
super(message);
|
|
45
|
-
this.code = code;
|
|
46
|
-
this.subType = subType;
|
|
47
|
-
this.httpCause = cause;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.HttpError = HttpError;
|
|
51
20
|
// Error subtype constants
|
|
52
21
|
exports.ENTITY_NOT_FOUND = 'EntityNotFoundError';
|
|
53
22
|
exports.WRONG_LOGIN_TYPE = 'wrongLoginType';
|
|
@@ -57,209 +26,70 @@ exports.EMAIL_NOT_CONFIRMED = 'email_not_confirmed';
|
|
|
57
26
|
exports.WRONG_DOMAIN = 'wrongdomain';
|
|
58
27
|
exports.WRONG_COMPANY = 'wrongcompany';
|
|
59
28
|
exports.NO_REG_CODE = 'noregcode';
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
constructor(message, cause) {
|
|
65
|
-
super(message, 404, undefined, cause);
|
|
66
|
-
this.name = exports.ENTITY_NOT_FOUND;
|
|
67
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.HttpNotFoundError = HttpNotFoundError;
|
|
71
|
-
/**
|
|
72
|
-
* EndpointNotFoundError - 404 for missing endpoints.
|
|
73
|
-
*/
|
|
74
|
-
class EndpointNotFoundError extends HttpNotFoundError {
|
|
75
|
-
constructor(message, cause) {
|
|
29
|
+
/** @deprecated Prefer ApiError semantic subclasses; custom HTTP status belongs in ErrorTranslators. */
|
|
30
|
+
class HttpError extends ApiError_1.ApiError {
|
|
31
|
+
code;
|
|
32
|
+
constructor(message, code, subType, cause) {
|
|
76
33
|
super(message, cause);
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.EndpointNotFoundError = EndpointNotFoundError;
|
|
82
|
-
/**
|
|
83
|
-
* HttpBadRequestError - 400 Bad Request.
|
|
84
|
-
* Used for validation errors with optional field and GUI message.
|
|
85
|
-
*/
|
|
86
|
-
class HttpBadRequestError extends HttpError {
|
|
87
|
-
field;
|
|
88
|
-
guiMessage;
|
|
89
|
-
constructor(message, field, guiMessage, cause) {
|
|
90
|
-
super(message, 400, undefined, cause);
|
|
91
|
-
this.name = 'BadRequest';
|
|
92
|
-
this.field = field;
|
|
93
|
-
this.guiMessage = guiMessage;
|
|
94
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
exports.HttpBadRequestError = HttpBadRequestError;
|
|
98
|
-
/**
|
|
99
|
-
* HttpUnauthorizedError - 401 Unauthorized.
|
|
100
|
-
*/
|
|
101
|
-
class HttpUnauthorizedError extends HttpError {
|
|
102
|
-
constructor(message, subType, cause) {
|
|
103
|
-
super(message, 401, subType, cause);
|
|
104
|
-
this.name = 'Unauthorized';
|
|
105
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.HttpUnauthorizedError = HttpUnauthorizedError;
|
|
109
|
-
/**
|
|
110
|
-
* HttpTooManyRequestsError - 429 Too Many Requests.
|
|
111
|
-
*
|
|
112
|
-
* The one member of the HttpError ladder that never made it over from the production service this ladder was ported from. Without it, apps are
|
|
113
|
-
* forced back to `err.code === 429` — the exact untyped pattern this ladder exists to replace.
|
|
114
|
-
*/
|
|
115
|
-
class HttpTooManyRequestsError extends HttpError {
|
|
116
|
-
constructor(message, cause) {
|
|
117
|
-
super(message, 429, undefined, cause);
|
|
118
|
-
this.name = 'TooManyRequests';
|
|
119
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.HttpTooManyRequestsError = HttpTooManyRequestsError;
|
|
123
|
-
/**
|
|
124
|
-
* HttpForbiddenError - 403 Forbidden.
|
|
125
|
-
*/
|
|
126
|
-
class HttpForbiddenError extends HttpError {
|
|
127
|
-
constructor(message, cause) {
|
|
128
|
-
super(message, 403, undefined, cause);
|
|
129
|
-
this.name = 'Forbidden';
|
|
130
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
exports.HttpForbiddenError = HttpForbiddenError;
|
|
134
|
-
/**
|
|
135
|
-
* HttpTimeoutError - 408 Request Timeout.
|
|
136
|
-
*/
|
|
137
|
-
class HttpTimeoutError extends HttpError {
|
|
138
|
-
constructor(message, cause) {
|
|
139
|
-
super(message, 408, undefined, cause);
|
|
140
|
-
this.name = 'Timeout';
|
|
141
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
exports.HttpTimeoutError = HttpTimeoutError;
|
|
145
|
-
/**
|
|
146
|
-
* HttpBadGatewayError - 502 Bad Gateway.
|
|
147
|
-
*/
|
|
148
|
-
class HttpBadGatewayError extends HttpError {
|
|
149
|
-
constructor(message, cause) {
|
|
150
|
-
super(message, 502, undefined, cause);
|
|
151
|
-
this.name = 'HttpBadGatewayError';
|
|
152
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
exports.HttpBadGatewayError = HttpBadGatewayError;
|
|
156
|
-
/**
|
|
157
|
-
* HttpServiceUnavailableError - 503 Service Unavailable.
|
|
158
|
-
*
|
|
159
|
-
* The cold-start code: a scale-to-zero backend (Cloud Run `min_instance_count = 0`) whose instance
|
|
160
|
-
* is still booting is answered by the load balancer with a 503 and ITS OWN HTML page — no
|
|
161
|
-
* ProtocolError body at all. Without this member the client fell through to a generic `HttpError`,
|
|
162
|
-
* so an app could not say "the server is waking, retry" without matching on `err.code === 503`,
|
|
163
|
-
* which is the untyped pattern this ladder exists to replace.
|
|
164
|
-
*/
|
|
165
|
-
class HttpServiceUnavailableError extends HttpError {
|
|
166
|
-
constructor(message, cause) {
|
|
167
|
-
super(message, 503, undefined, cause);
|
|
168
|
-
this.name = 'HttpServiceUnavailableError';
|
|
169
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
exports.HttpServiceUnavailableError = HttpServiceUnavailableError;
|
|
173
|
-
/**
|
|
174
|
-
* HttpGatewayTimeoutError - 504 Gateway Timeout.
|
|
175
|
-
* SHOULD NOT BE USED SERVER SIDE SINCE ALBs will return 504 and it will not be translated
|
|
176
|
-
* to json body 'ProtocolError'.
|
|
177
|
-
*/
|
|
178
|
-
class HttpGatewayTimeoutError extends HttpError {
|
|
179
|
-
constructor(message, cause) {
|
|
180
|
-
super(message, 504, undefined, cause);
|
|
181
|
-
this.name = 'HttpGatewayTimeoutError';
|
|
182
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
exports.HttpGatewayTimeoutError = HttpGatewayTimeoutError;
|
|
186
|
-
/**
|
|
187
|
-
* HttpInternalServerError - 500 Internal Server Error.
|
|
188
|
-
*/
|
|
189
|
-
class HttpInternalServerError extends HttpError {
|
|
190
|
-
constructor(message, cause) {
|
|
191
|
-
super(message, 500, undefined, cause);
|
|
192
|
-
this.name = 'InternalServerError';
|
|
193
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
exports.HttpInternalServerError = HttpInternalServerError;
|
|
197
|
-
/**
|
|
198
|
-
* HttpVendorError - 598 Vendor Error.
|
|
199
|
-
* Custom status code for vendor/external service errors with retry hint.
|
|
200
|
-
*/
|
|
201
|
-
class HttpVendorError extends HttpError {
|
|
202
|
-
waitSeconds;
|
|
203
|
-
constructor(message, waitSeconds = 30, cause) {
|
|
204
|
-
super(message, 598, undefined, cause);
|
|
205
|
-
this.waitSeconds = waitSeconds;
|
|
206
|
-
this.name = 'VendorError';
|
|
207
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
exports.HttpVendorError = HttpVendorError;
|
|
211
|
-
/**
|
|
212
|
-
* HttpUserError - User validation error with 2xx status code.
|
|
213
|
-
*
|
|
214
|
-
* Uses HTTP 266 (non-standard 2xx code) intentionally because:
|
|
215
|
-
* 1. User validation errors are "successful" from server perspective - user just made a mistake
|
|
216
|
-
* 2. Browser DevTools show 4xx/5xx codes in RED, which is confusing for user validation
|
|
217
|
-
* 3. Allows error to propagate up the stack via throw without triggering error monitoring
|
|
218
|
-
* 4. Avoids polluting logs with "errors" that are actually expected user behavior
|
|
219
|
-
*
|
|
220
|
-
* This is a deliberate design pattern - do NOT change to 4xx codes.
|
|
221
|
-
* Examples: "Email already exists", "Invalid password format", "Required field missing"
|
|
222
|
-
*
|
|
223
|
-
* # It is also the ONLY type whose `message` reaches the caller
|
|
224
|
-
*
|
|
225
|
-
* `HttpErrorWireMapper` (http-server) copies `message` onto the response body for this type and no
|
|
226
|
-
* other; every other subclass sends the generic HTTP reason phrase for its status. That is not an
|
|
227
|
-
* arbitrary exception — it follows from the four points above. This type MEANS "this text was written
|
|
228
|
-
* for a human to read", where `Error.message` everywhere else means "this text was written for whoever
|
|
229
|
-
* reads the logs" and routinely quotes downstream urls, response bodies and internal ids.
|
|
230
|
-
*
|
|
231
|
-
* So: text the user must SEE goes in an `HttpUserError` (or in `HttpBadRequestError.guiMessage`,
|
|
232
|
-
* which is the same idea one field down). Throwing `new HttpForbiddenError('you need the admin role
|
|
233
|
-
* on tenant 4471')` shows the user 'Forbidden' and nothing else.
|
|
234
|
-
*/
|
|
235
|
-
class HttpUserError extends HttpError {
|
|
236
|
-
errorCode;
|
|
237
|
-
constructor(message, errorCode, cause) {
|
|
238
|
-
super(message, 266, 'USER_ERROR', cause);
|
|
239
|
-
this.name = 'UserError';
|
|
240
|
-
this.errorCode = errorCode;
|
|
241
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
34
|
+
this.code = code;
|
|
35
|
+
this.subType = subType;
|
|
242
36
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* OfflineError - the request never reached a server.
|
|
247
|
-
*
|
|
248
|
-
* Offline, DNS failure, connection refused, CORS preflight rejected: `fetch` itself rejected, so no
|
|
249
|
-
* Response — and therefore no HTTP status — ever existed. That is precisely why this extends `Error`
|
|
250
|
-
* and NOT `HttpError`: an `HttpError` carries a `code` and means "the server replied with a failure",
|
|
251
|
-
* a different situation a caller usually retries differently. Subclassing it would give this a bogus
|
|
252
|
-
* status and make it match `instanceof HttpError` ladders that must not catch a transport reject.
|
|
253
|
-
*
|
|
254
|
-
* The original failure (a raw `TypeError: Failed to fetch`, or undici's coded reject) is always
|
|
255
|
-
* preserved as `cause`, so a caller that wants the underlying detail can still reach it.
|
|
256
|
-
*/
|
|
257
|
-
class OfflineError extends Error {
|
|
258
|
-
constructor(message, cause) {
|
|
259
|
-
super(message, { cause });
|
|
260
|
-
this.name = 'OfflineError';
|
|
261
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
37
|
+
/** @deprecated Use the standard Error.cause. */
|
|
38
|
+
get httpCause() {
|
|
39
|
+
return this.cause instanceof Error ? this.cause : undefined;
|
|
262
40
|
}
|
|
263
41
|
}
|
|
264
|
-
exports.
|
|
42
|
+
exports.HttpError = HttpError;
|
|
43
|
+
var ApiError_2 = require("../errors/ApiError");
|
|
44
|
+
Object.defineProperty(exports, "EndpointNotFoundError", { enumerable: true, get: function () { return ApiError_2.EndpointNotFoundError; } });
|
|
45
|
+
Object.defineProperty(exports, "OfflineError", { enumerable: true, get: function () { return ApiError_2.OfflineError; } });
|
|
46
|
+
/** @deprecated Use NotFoundError from @webpieces/core-util/errors. Same constructor identity. */
|
|
47
|
+
var ApiError_3 = require("../errors/ApiError");
|
|
48
|
+
Object.defineProperty(exports, "HttpNotFoundError", { enumerable: true, get: function () { return ApiError_3.NotFoundError; } });
|
|
49
|
+
/** @deprecated Use BadRequestError from @webpieces/core-util/errors. Same constructor identity. */
|
|
50
|
+
var ApiError_4 = require("../errors/ApiError");
|
|
51
|
+
Object.defineProperty(exports, "HttpBadRequestError", { enumerable: true, get: function () { return ApiError_4.BadRequestError; } });
|
|
52
|
+
/** @deprecated Use UnauthorizedError from @webpieces/core-util/errors. Same constructor identity. */
|
|
53
|
+
var ApiError_5 = require("../errors/ApiError");
|
|
54
|
+
Object.defineProperty(exports, "HttpUnauthorizedError", { enumerable: true, get: function () { return ApiError_5.UnauthorizedError; } });
|
|
55
|
+
/** @deprecated Use TooManyRequestsError from @webpieces/core-util/errors. Same constructor identity. */
|
|
56
|
+
var ApiError_6 = require("../errors/ApiError");
|
|
57
|
+
Object.defineProperty(exports, "HttpTooManyRequestsError", { enumerable: true, get: function () { return ApiError_6.TooManyRequestsError; } });
|
|
58
|
+
/** @deprecated Use ForbiddenError from @webpieces/core-util/errors. Same constructor identity. */
|
|
59
|
+
var ApiError_7 = require("../errors/ApiError");
|
|
60
|
+
Object.defineProperty(exports, "HttpForbiddenError", { enumerable: true, get: function () { return ApiError_7.ForbiddenError; } });
|
|
61
|
+
/** @deprecated Use RequestTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
|
|
62
|
+
var ApiError_8 = require("../errors/ApiError");
|
|
63
|
+
Object.defineProperty(exports, "HttpTimeoutError", { enumerable: true, get: function () { return ApiError_8.RequestTimeoutError; } });
|
|
64
|
+
/** @deprecated Use BadGatewayError from @webpieces/core-util/errors. Same constructor identity. */
|
|
65
|
+
var ApiError_9 = require("../errors/ApiError");
|
|
66
|
+
Object.defineProperty(exports, "HttpBadGatewayError", { enumerable: true, get: function () { return ApiError_9.BadGatewayError; } });
|
|
67
|
+
/** @deprecated Use ServiceUnavailableError from @webpieces/core-util/errors. Same constructor identity. */
|
|
68
|
+
var ApiError_10 = require("../errors/ApiError");
|
|
69
|
+
Object.defineProperty(exports, "HttpServiceUnavailableError", { enumerable: true, get: function () { return ApiError_10.ServiceUnavailableError; } });
|
|
70
|
+
/** @deprecated Use GatewayTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
|
|
71
|
+
var ApiError_11 = require("../errors/ApiError");
|
|
72
|
+
Object.defineProperty(exports, "HttpGatewayTimeoutError", { enumerable: true, get: function () { return ApiError_11.GatewayTimeoutError; } });
|
|
73
|
+
/** @deprecated Use InternalError from @webpieces/core-util/errors. Same constructor identity. */
|
|
74
|
+
var ApiError_12 = require("../errors/ApiError");
|
|
75
|
+
Object.defineProperty(exports, "HttpInternalServerError", { enumerable: true, get: function () { return ApiError_12.InternalError; } });
|
|
76
|
+
/** @deprecated Use VendorError from @webpieces/core-util/errors. Same constructor identity. */
|
|
77
|
+
var ApiError_13 = require("../errors/ApiError");
|
|
78
|
+
Object.defineProperty(exports, "HttpVendorError", { enumerable: true, get: function () { return ApiError_13.VendorError; } });
|
|
79
|
+
/** @deprecated Use UserError from @webpieces/core-util/errors. Same constructor identity. */
|
|
80
|
+
var ApiError_14 = require("../errors/ApiError");
|
|
81
|
+
Object.defineProperty(exports, "HttpUserError", { enumerable: true, get: function () { return ApiError_14.UserError; } });
|
|
82
|
+
var ApiError_15 = require("../errors/ApiError");
|
|
83
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return ApiError_15.NotFoundError; } });
|
|
84
|
+
Object.defineProperty(exports, "BadGatewayError", { enumerable: true, get: function () { return ApiError_15.BadGatewayError; } });
|
|
85
|
+
Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return ApiError_15.ServiceUnavailableError; } });
|
|
86
|
+
Object.defineProperty(exports, "GatewayTimeoutError", { enumerable: true, get: function () { return ApiError_15.GatewayTimeoutError; } });
|
|
87
|
+
Object.defineProperty(exports, "InternalError", { enumerable: true, get: function () { return ApiError_15.InternalError; } });
|
|
88
|
+
Object.defineProperty(exports, "TooManyRequestsError", { enumerable: true, get: function () { return ApiError_15.TooManyRequestsError; } });
|
|
89
|
+
Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return ApiError_15.ForbiddenError; } });
|
|
90
|
+
Object.defineProperty(exports, "RequestTimeoutError", { enumerable: true, get: function () { return ApiError_15.RequestTimeoutError; } });
|
|
91
|
+
Object.defineProperty(exports, "UserError", { enumerable: true, get: function () { return ApiError_15.UserError; } });
|
|
92
|
+
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return ApiError_15.BadRequestError; } });
|
|
93
|
+
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return ApiError_15.UnauthorizedError; } });
|
|
94
|
+
Object.defineProperty(exports, "VendorError", { enumerable: true, get: function () { return ApiError_15.VendorError; } });
|
|
265
95
|
//# sourceMappingURL=errors.js.map
|
package/src/http/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/http/errors.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;;;;;;GAYG;AACH,MAAa,aAAa;IACf,OAAO,CAAU;IACjB,OAAO,CAAU;IACjB,KAAK,CAAU;IACf,WAAW,CAAU;IAC5B;;;OAGG;IACI,IAAI,CAAU;IACd,eAAe,CAAU;IACzB,SAAS,CAAU;CAC7B;AAZD,sCAYC;AAED;;;GAGG;AACH,MAAa,SAAU,SAAQ,KAAK;IACzB,IAAI,CAAS;IACb,OAAO,CAAU;IACR,SAAS,CAAS;IAElC,YACI,OAAe,EACf,IAAY,EACZ,OAAgB,EAChB,KAAa;QAEb,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;CACJ;AAhBD,8BAgBC;AAED,0BAA0B;AACb,QAAA,gBAAgB,GAAG,qBAAqB,CAAC;AACzC,QAAA,gBAAgB,GAAG,gBAAgB,CAAC;AACpC,QAAA,WAAW,GAAG,YAAY,CAAC;AAC3B,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0DAMC;AAED;;;GAGG;AACH,MAAa,eAAgB,SAAQ,SAAS;IAG/B;IAFX,YACI,OAAe,EACR,cAAc,EAAE,EACvB,KAAa;QAEb,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAH/B,gBAAW,GAAX,WAAW,CAAK;QAIvB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACJ;AAVD,0CAUC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,aAAc,SAAQ,SAAS;IACjC,SAAS,CAAU;IAE1B,YAAY,OAAe,EAAE,SAAkB,EAAE,KAAa;QAC1D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACJ;AATD,sCASC;AAED;;;;;;;;;;;GAWG;AACH,MAAa,YAAa,SAAQ,KAAK;IACnC,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACJ;AAND,oCAMC","sourcesContent":["/**\n * HTTP Error classes for webpieces-ts.\n * These errors are used throughout the framework for consistent error handling.\n */\n\n/**\n * ProtocolError - Data class for error response body.\n * This is what gets serialized and sent to the client.\n *\n * EVERY field here is caller-facing, so the framework fills it CONSERVATIVELY. `HttpErrorWireMapper`\n * (http-server) copies `message` from the thrown error for {@link HttpUserError} ONLY — the one type\n * whose message is written for a human to read — and sends the generic HTTP reason phrase for every\n * other type, because `Error.message` is an operator-facing field that routinely quotes downstream\n * urls, response bodies and internal ids. `name` is not filled by that ladder at all.\n *\n * An app that wants to publish more than that does it deliberately, by installing an\n * {@link ErrorTranslators} on {@link ClientRegistry}, whose `toWire()` response is sent verbatim.\n */\nexport class ProtocolError {\n public message?: string;\n public subType?: string;\n public field?: string;\n public waitSeconds?: number;\n /**\n * Filled only by an app's own `ErrorTranslators.toWire()`. The built-in HttpError ladder does NOT\n * send it: nothing on the client reads it, and for a subclass it is an internal class name.\n */\n public name?: string;\n public guiAlertMessage?: string;\n public errorCode?: string;\n}\n\n/**\n * HttpError - Base error class with HTTP status code.\n * All specific HTTP errors extend this class.\n */\nexport class HttpError extends Error {\n public code: number;\n public subType?: string;\n public readonly httpCause?: Error;\n\n constructor(\n message: string,\n code: number,\n subType?: string,\n cause?: Error,\n ) {\n super(message);\n this.code = code;\n this.subType = subType;\n this.httpCause = cause;\n }\n}\n\n// Error subtype constants\nexport const ENTITY_NOT_FOUND = 'EntityNotFoundError';\nexport const WRONG_LOGIN_TYPE = 'wrongLoginType';\nexport const WRONG_LOGIN = 'wronglogin';\nexport const NOT_APPROVED = 'notapproved';\nexport const EMAIL_NOT_CONFIRMED = 'email_not_confirmed';\nexport const WRONG_DOMAIN = 'wrongdomain';\nexport const WRONG_COMPANY = 'wrongcompany';\nexport const NO_REG_CODE = 'noregcode';\n\n/**\n * HttpNotFoundError - 404 Not Found.\n */\nexport class HttpNotFoundError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 404, undefined, cause);\n this.name = ENTITY_NOT_FOUND;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * EndpointNotFoundError - 404 for missing endpoints.\n */\nexport class EndpointNotFoundError extends HttpNotFoundError {\n constructor(message: string, cause?: Error) {\n super(message, cause);\n this.name = 'EndpointNotFoundError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpBadRequestError - 400 Bad Request.\n * Used for validation errors with optional field and GUI message.\n */\nexport class HttpBadRequestError extends HttpError {\n public field?: string;\n public guiMessage?: string;\n\n constructor(message: string, field?: string, guiMessage?: string, cause?: Error) {\n super(message, 400, undefined, cause);\n this.name = 'BadRequest';\n this.field = field;\n this.guiMessage = guiMessage;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpUnauthorizedError - 401 Unauthorized.\n */\nexport class HttpUnauthorizedError extends HttpError {\n constructor(message: string, subType?: string, cause?: Error) {\n super(message, 401, subType, cause);\n this.name = 'Unauthorized';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpTooManyRequestsError - 429 Too Many Requests.\n *\n * The one member of the HttpError ladder that never made it over from the production service this ladder was ported from. Without it, apps are\n * forced back to `err.code === 429` — the exact untyped pattern this ladder exists to replace.\n */\nexport class HttpTooManyRequestsError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 429, undefined, cause);\n this.name = 'TooManyRequests';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpForbiddenError - 403 Forbidden.\n */\nexport class HttpForbiddenError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 403, undefined, cause);\n this.name = 'Forbidden';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpTimeoutError - 408 Request Timeout.\n */\nexport class HttpTimeoutError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 408, undefined, cause);\n this.name = 'Timeout';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpBadGatewayError - 502 Bad Gateway.\n */\nexport class HttpBadGatewayError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 502, undefined, cause);\n this.name = 'HttpBadGatewayError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpServiceUnavailableError - 503 Service Unavailable.\n *\n * The cold-start code: a scale-to-zero backend (Cloud Run `min_instance_count = 0`) whose instance\n * is still booting is answered by the load balancer with a 503 and ITS OWN HTML page — no\n * ProtocolError body at all. Without this member the client fell through to a generic `HttpError`,\n * so an app could not say \"the server is waking, retry\" without matching on `err.code === 503`,\n * which is the untyped pattern this ladder exists to replace.\n */\nexport class HttpServiceUnavailableError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 503, undefined, cause);\n this.name = 'HttpServiceUnavailableError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpGatewayTimeoutError - 504 Gateway Timeout.\n * SHOULD NOT BE USED SERVER SIDE SINCE ALBs will return 504 and it will not be translated\n * to json body 'ProtocolError'.\n */\nexport class HttpGatewayTimeoutError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 504, undefined, cause);\n this.name = 'HttpGatewayTimeoutError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpInternalServerError - 500 Internal Server Error.\n */\nexport class HttpInternalServerError extends HttpError {\n constructor(message: string, cause?: Error) {\n super(message, 500, undefined, cause);\n this.name = 'InternalServerError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpVendorError - 598 Vendor Error.\n * Custom status code for vendor/external service errors with retry hint.\n */\nexport class HttpVendorError extends HttpError {\n constructor(\n message: string,\n public waitSeconds = 30,\n cause?: Error,\n ) {\n super(message, 598, undefined, cause);\n this.name = 'VendorError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * HttpUserError - User validation error with 2xx status code.\n *\n * Uses HTTP 266 (non-standard 2xx code) intentionally because:\n * 1. User validation errors are \"successful\" from server perspective - user just made a mistake\n * 2. Browser DevTools show 4xx/5xx codes in RED, which is confusing for user validation\n * 3. Allows error to propagate up the stack via throw without triggering error monitoring\n * 4. Avoids polluting logs with \"errors\" that are actually expected user behavior\n *\n * This is a deliberate design pattern - do NOT change to 4xx codes.\n * Examples: \"Email already exists\", \"Invalid password format\", \"Required field missing\"\n *\n * # It is also the ONLY type whose `message` reaches the caller\n *\n * `HttpErrorWireMapper` (http-server) copies `message` onto the response body for this type and no\n * other; every other subclass sends the generic HTTP reason phrase for its status. That is not an\n * arbitrary exception — it follows from the four points above. This type MEANS \"this text was written\n * for a human to read\", where `Error.message` everywhere else means \"this text was written for whoever\n * reads the logs\" and routinely quotes downstream urls, response bodies and internal ids.\n *\n * So: text the user must SEE goes in an `HttpUserError` (or in `HttpBadRequestError.guiMessage`,\n * which is the same idea one field down). Throwing `new HttpForbiddenError('you need the admin role\n * on tenant 4471')` shows the user 'Forbidden' and nothing else.\n */\nexport class HttpUserError extends HttpError {\n public errorCode?: string;\n\n constructor(message: string, errorCode?: string, cause?: Error) {\n super(message, 266, 'USER_ERROR', cause);\n this.name = 'UserError';\n this.errorCode = errorCode;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * OfflineError - the request never reached a server.\n *\n * Offline, DNS failure, connection refused, CORS preflight rejected: `fetch` itself rejected, so no\n * Response — and therefore no HTTP status — ever existed. That is precisely why this extends `Error`\n * and NOT `HttpError`: an `HttpError` carries a `code` and means \"the server replied with a failure\",\n * a different situation a caller usually retries differently. Subclassing it would give this a bogus\n * status and make it match `instanceof HttpError` ladders that must not catch a transport reject.\n *\n * The original failure (a raw `TypeError: Failed to fetch`, or undici's coded reject) is always\n * preserved as `cause`, so a caller that wants the underlying detail can still reach it.\n */\nexport class OfflineError extends Error {\n constructor(message: string, cause?: Error) {\n super(message, { cause });\n this.name = 'OfflineError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/http/errors.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAiFrC,yFAjFA,mBAAQ,OAiFA;AAhFjB,MAAa,aAAa;IACf,OAAO,CAAU;IACjB,OAAO,CAAU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uG;AACvG,+CAA6E;AAApE,4GAAA,mBAAmB,OAAoB;AAChD,mGAAmG;AACnG,+CAA4E;AAAnE,+GAAA,eAAe,OAAuB;AAC/C,2GAA2G;AAC3G,gDAA4F;AAAnF,wHAAA,uBAAuB,OAA+B;AAC/D,uGAAuG;AACvG,gDAAoF;AAA3E,oHAAA,mBAAmB,OAA2B;AACvD,iGAAiG;AACjG,gDAA8E;AAArE,oHAAA,aAAa,OAA2B;AACjD,+FAA+F;AAC/F,gDAAoE;AAA3D,4GAAA,WAAW,OAAmB;AACvC,6FAA6F;AAC7F,gDAAgE;AAAvD,0GAAA,SAAS,OAAiB;AAEnC,gDAa4B;AAZxB,0GAAA,aAAa,OAAA;AACb,4GAAA,eAAe,OAAA;AACf,oHAAA,uBAAuB,OAAA;AACvB,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AACb,iHAAA,oBAAoB,OAAA;AACpB,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AACnB,sGAAA,SAAS,OAAA;AACT,4GAAA,eAAe,OAAA;AACf,8GAAA,iBAAiB,OAAA;AACjB,wGAAA,WAAW,OAAA","sourcesContent":["import { ApiError } from '../errors/ApiError';\nexport class ProtocolError {\n public message?: string;\n public subType?: string;\n public field?: string;\n public waitSeconds?: number;\n /**\n * Filled only by an app's own `ErrorTranslators.toWire()`. The built-in HttpError ladder does NOT\n * send it: nothing on the client reads it, and for a subclass it is an internal class name.\n */\n public name?: string;\n public guiAlertMessage?: string;\n public errorCode?: string;\n}\n\n// Error subtype constants\nexport const ENTITY_NOT_FOUND = 'EntityNotFoundError';\nexport const WRONG_LOGIN_TYPE = 'wrongLoginType';\nexport const WRONG_LOGIN = 'wronglogin';\nexport const NOT_APPROVED = 'notapproved';\nexport const EMAIL_NOT_CONFIRMED = 'email_not_confirmed';\nexport const WRONG_DOMAIN = 'wrongdomain';\nexport const WRONG_COMPANY = 'wrongcompany';\nexport const NO_REG_CODE = 'noregcode';\n\n/** @deprecated Prefer ApiError semantic subclasses; custom HTTP status belongs in ErrorTranslators. */\nexport class HttpError extends ApiError {\n constructor(\n message: string,\n public code: number,\n subType?: string,\n cause?: Error,\n ) {\n super(message, cause);\n this.subType = subType;\n }\n /** @deprecated Use the standard Error.cause. */\n get httpCause(): Error | undefined {\n return this.cause instanceof Error ? this.cause : undefined;\n }\n}\nexport { EndpointNotFoundError, OfflineError } from '../errors/ApiError';\n/** @deprecated Use NotFoundError from @webpieces/core-util/errors. Same constructor identity. */\nexport { NotFoundError as HttpNotFoundError } from '../errors/ApiError';\n/** @deprecated Use BadRequestError from @webpieces/core-util/errors. Same constructor identity. */\nexport { BadRequestError as HttpBadRequestError } from '../errors/ApiError';\n/** @deprecated Use UnauthorizedError from @webpieces/core-util/errors. Same constructor identity. */\nexport { UnauthorizedError as HttpUnauthorizedError } from '../errors/ApiError';\n/** @deprecated Use TooManyRequestsError from @webpieces/core-util/errors. Same constructor identity. */\nexport { TooManyRequestsError as HttpTooManyRequestsError } from '../errors/ApiError';\n/** @deprecated Use ForbiddenError from @webpieces/core-util/errors. Same constructor identity. */\nexport { ForbiddenError as HttpForbiddenError } from '../errors/ApiError';\n/** @deprecated Use RequestTimeoutError from @webpieces/core-util/errors. Same constructor identity. */\nexport { RequestTimeoutError as HttpTimeoutError } from '../errors/ApiError';\n/** @deprecated Use BadGatewayError from @webpieces/core-util/errors. Same constructor identity. */\nexport { BadGatewayError as HttpBadGatewayError } from '../errors/ApiError';\n/** @deprecated Use ServiceUnavailableError from @webpieces/core-util/errors. Same constructor identity. */\nexport { ServiceUnavailableError as HttpServiceUnavailableError } from '../errors/ApiError';\n/** @deprecated Use GatewayTimeoutError from @webpieces/core-util/errors. Same constructor identity. */\nexport { GatewayTimeoutError as HttpGatewayTimeoutError } from '../errors/ApiError';\n/** @deprecated Use InternalError from @webpieces/core-util/errors. Same constructor identity. */\nexport { InternalError as HttpInternalServerError } from '../errors/ApiError';\n/** @deprecated Use VendorError from @webpieces/core-util/errors. Same constructor identity. */\nexport { VendorError as HttpVendorError } from '../errors/ApiError';\n/** @deprecated Use UserError from @webpieces/core-util/errors. Same constructor identity. */\nexport { UserError as HttpUserError } from '../errors/ApiError';\n\nexport {\n NotFoundError,\n BadGatewayError,\n ServiceUnavailableError,\n GatewayTimeoutError,\n InternalError,\n TooManyRequestsError,\n ForbiddenError,\n RequestTimeoutError,\n UserError,\n BadRequestError,\n UnauthorizedError,\n VendorError,\n} from '../errors/ApiError';\nexport { ApiError };\n"]}
|
package/src/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { toError } from './lib/errorUtils';
|
|
10
10
|
export { ContextKey } from './ContextKey';
|
|
11
|
-
export type { AnyContextKey, AnyTrustedContextKey, AnyUntrustedContextKey, Trust } from './ContextKey';
|
|
11
|
+
export type { AnyContextKey, AnyTrustedContextKey, AnyUntrustedContextKey, Trust, } from './ContextKey';
|
|
12
12
|
export { ContextTuple } from './ContextTuple';
|
|
13
13
|
export { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './DocumentDesign';
|
|
14
14
|
export type { Logger, LogLevel } from './logging/Logger';
|
|
@@ -16,15 +16,15 @@ export type { LoggerFactory } from './logging/LoggerFactory';
|
|
|
16
16
|
export { ConsoleLogger } from './logging/ConsoleLogger';
|
|
17
17
|
export { ConsoleLoggerFactory } from './logging/ConsoleLoggerFactory';
|
|
18
18
|
export { LogManager } from './logging/LogManager';
|
|
19
|
-
export { LogChunker, LogChunkerImpl, LogChunkInfo, MAX_GCP_LOG_BYTES, GCP_LOG_BUDGET_BYTES } from './logging/LogChunker';
|
|
19
|
+
export { LogChunker, LogChunkerImpl, LogChunkInfo, MAX_GCP_LOG_BYTES, GCP_LOG_BUDGET_BYTES, } from './logging/LogChunker';
|
|
20
20
|
export { ApiPath, Endpoint, Public, AuthJwt, rolesRequired, MISSING_AUTH_DECORATOR_FIX, AuthOidc, AuthSharedSecret, AuthWebhook, AuthApiKey, AuthLocalOnly, MaskLog, getApiPath, getEndpoints, getEndpointOptions, getEndpointKind, getEndpointKinds, getMaskSpec, isFormPost, isRawBody, isApiPath, getAuthMeta, getAuthMode, assertEveryEndpointHasAuthMode, assertEveryExternalEndpointDeclaresCaller, assertEveryWebhookEndpointRetainsRawBody, validateNoConflictingDecorators, METADATA_KEYS, } from './http/decorators';
|
|
21
21
|
export { RouteMetadata } from './http/RouteMetadata';
|
|
22
22
|
export type { EndpointKind, EndpointOptions, ExternalEndpointOptions } from './http/decorators';
|
|
23
23
|
export { AuthMeta } from './http/auth-mode';
|
|
24
|
-
export type { AuthMode, ApiKeyCredential, ApiKeyCredentials, JwtRoles, JwtRequirement } from './http/auth-mode';
|
|
24
|
+
export type { AuthMode, ApiKeyCredential, ApiKeyCredentials, JwtRoles, JwtRequirement, } from './http/auth-mode';
|
|
25
25
|
export { Rpc, PubSub, Queue, ENDPOINT_KINDS_BY_API_KIND, getApiKind, assertApiKind, assertPubSubConventions, getQueueName, } from './http/api-kind';
|
|
26
26
|
export type { ApiKind } from './http/api-kind';
|
|
27
|
-
export { EXTERNAL_SYSTEM_KINDS, DEFAULT_CALLER_KIND, ExternalCaller, isExternalSystemKind, getEndpointCaller } from './http/external-caller';
|
|
27
|
+
export { EXTERNAL_SYSTEM_KINDS, DEFAULT_CALLER_KIND, ExternalCaller, isExternalSystemKind, getEndpointCaller, } from './http/external-caller';
|
|
28
28
|
export type { ExternalSystemKind } from './http/external-caller';
|
|
29
29
|
export { Secrets, SECRETS } from './http/Secrets';
|
|
30
30
|
export { ValidateImplementation } from './http/validators';
|
|
@@ -57,14 +57,16 @@ export { MaskSpec } from './http/LogFieldMask';
|
|
|
57
57
|
export type { MaskMode } from './http/LogFieldMask';
|
|
58
58
|
export { ApiCallInfo } from './http/ApiCallInfo';
|
|
59
59
|
export type { ApiType, ApiResult } from './http/ApiCallInfo';
|
|
60
|
-
export { ApiCallLogName, ApiCallLogNameImpl, LOG_API_CALL_LOGGER_NAME } from './http/ApiCallLogName';
|
|
60
|
+
export { ApiCallLogName, ApiCallLogNameImpl, LOG_API_CALL_LOGGER_NAME, } from './http/ApiCallLogName';
|
|
61
61
|
export { ApiMethodInfo } from './http/ApiMethodInfo';
|
|
62
62
|
export type { ApiSide } from './http/ApiMethodInfo';
|
|
63
63
|
export type { ApiCallContext } from './http/ApiCallContext';
|
|
64
64
|
export { TestCaseRecorder, RecorderKeys } from './http/recorder/TestCaseRecorder';
|
|
65
|
-
export { RecordedEndpoint, RecordedError, RecordedTestCase } from './http/recorder/RecordedEndpoint';
|
|
65
|
+
export { RecordedEndpoint, RecordedError, RecordedTestCase, } from './http/recorder/RecordedEndpoint';
|
|
66
66
|
export { DoNotRecord, getDoNotRecordFields } from './http/recorder/DoNotRecord';
|
|
67
67
|
export { RecordSerializer, SerializedMap, SerializedError } from './http/recorder/RecordSerializer';
|
|
68
68
|
export { Filter } from './filters/Filter';
|
|
69
69
|
export type { Service } from './filters/Filter';
|
|
70
70
|
export { FilterChain } from './filters/FilterChain';
|
|
71
|
+
export { ApiError, NotFoundError, BadGatewayError, ServiceUnavailableError, GatewayTimeoutError, InternalError, TooManyRequestsError, ForbiddenError, RequestTimeoutError, UserError, BadRequestError, UnauthorizedError, VendorError, ApiErrorCodec, ApiErrorPayload, } from './errors';
|
|
72
|
+
export { HttpErrorStatus } from './http/HttpErrorStatus';
|