@web-ts-toolkit/http-errors 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.mts +6 -0
- package/index.d.ts +6 -0
- package/package.json +2 -2
package/index.d.mts
CHANGED
|
@@ -72,6 +72,12 @@ declare const toAip193ErrorPayload: (error: HttpErrorShape, fallbackDomain?: str
|
|
|
72
72
|
declare const toRfc9457ErrorPayload: <TError = unknown>(error: HttpErrorShape) => Rfc9457ErrorPayload<TError>;
|
|
73
73
|
declare const toRfc9457ValidationErrorPayload: (error: HttpErrorShape) => Rfc9457ErrorPayload<Rfc9457ValidationError>;
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Base typed HTTP error with a numeric `statusCode` and machine-readable metadata.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* throw new HttpError(503, 'please try again later');
|
|
80
|
+
*/
|
|
75
81
|
declare class HttpError extends Error {
|
|
76
82
|
readonly statusCode: number;
|
|
77
83
|
readonly status: string;
|
package/index.d.ts
CHANGED
|
@@ -72,6 +72,12 @@ declare const toAip193ErrorPayload: (error: HttpErrorShape, fallbackDomain?: str
|
|
|
72
72
|
declare const toRfc9457ErrorPayload: <TError = unknown>(error: HttpErrorShape) => Rfc9457ErrorPayload<TError>;
|
|
73
73
|
declare const toRfc9457ValidationErrorPayload: (error: HttpErrorShape) => Rfc9457ErrorPayload<Rfc9457ValidationError>;
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Base typed HTTP error with a numeric `statusCode` and machine-readable metadata.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* throw new HttpError(503, 'please try again later');
|
|
80
|
+
*/
|
|
75
81
|
declare class HttpError extends Error {
|
|
76
82
|
readonly statusCode: number;
|
|
77
83
|
readonly status: string;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@web-ts-toolkit/http-errors",
|
|
3
3
|
"description": "Typed HTTP error classes and payload helpers for backend APIs",
|
|
4
4
|
"homepage": "https://web-ts-toolkit.pages.dev/docs/packages/http-errors",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.6.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"keywords": [
|
|
8
8
|
"http-errors",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"node": ">=20"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@web-ts-toolkit/utils": "0.
|
|
29
|
+
"@web-ts-toolkit/utils": "0.6.0"
|
|
30
30
|
},
|
|
31
31
|
"author": "Junmin Ahn",
|
|
32
32
|
"bugs": {
|