@keq-request/exception 5.0.0-beta.6 → 5.0.0-beta.8
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/CHANGELOG.md +16 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.0.0-beta.8
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a183653: **Feat:** add clarifyFetchFailed middleware.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- keq@5.0.0-beta.8
|
|
12
|
+
|
|
13
|
+
## 5.0.0-beta.7
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- keq@5.0.0-beta.7
|
|
18
|
+
|
|
3
19
|
## 5.0.0-beta.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -14,5 +14,8 @@ declare function validateStatusCode(): KeqMiddleware;
|
|
|
14
14
|
//#region src/create-exception-by-status-code.d.ts
|
|
15
15
|
declare function createExceptionByStatusCode(response: Response): Error;
|
|
16
16
|
//#endregion
|
|
17
|
-
|
|
17
|
+
//#region src/clarify-fetch-failed.d.ts
|
|
18
|
+
declare function clarifyFetchFailed(): KeqMiddleware;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Check, catchException, clarifyFetchFailed, createExceptionByStatusCode, throwException, validateStatusCode };
|
|
18
21
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/validate-status-code.ts","../src/create-exception-by-status-code.ts"],"mappings":";;;;KAIY,KAAA,IAAS,GAAA,EAAK,UAAA,KAAe,UAAA;AAAA,iBAEzB,cAAA,CAAe,KAAA,EAAO,KAAA,GAAQ,aAAA;;;iBCF9B,cAAA,CAAe,OAAA,GAAU,CAAA,cAAe,UAAA,SAAmB,aAAA;;;iBCD3D,kBAAA,CAAA,GAAsB,aAAA;;;iBCqBtB,2BAAA,CAA4B,QAAA,EAAU,QAAA,GAAW,KAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/validate-status-code.ts","../src/create-exception-by-status-code.ts","../src/clarify-fetch-failed.ts"],"mappings":";;;;KAIY,KAAA,IAAS,GAAA,EAAK,UAAA,KAAe,UAAA;AAAA,iBAEzB,cAAA,CAAe,KAAA,EAAO,KAAA,GAAQ,aAAA;;;iBCF9B,cAAA,CAAe,OAAA,GAAU,CAAA,cAAe,UAAA,SAAmB,aAAA;;;iBCD3D,kBAAA,CAAA,GAAsB,aAAA;;;iBCqBtB,2BAAA,CAA4B,QAAA,EAAU,QAAA,GAAW,KAAA;;;iBCtBjD,kBAAA,CAAA,GAAsB,aAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,5 +14,8 @@ declare function validateStatusCode(): KeqMiddleware;
|
|
|
14
14
|
//#region src/create-exception-by-status-code.d.ts
|
|
15
15
|
declare function createExceptionByStatusCode(response: Response): Error;
|
|
16
16
|
//#endregion
|
|
17
|
-
|
|
17
|
+
//#region src/clarify-fetch-failed.d.ts
|
|
18
|
+
declare function clarifyFetchFailed(): KeqMiddleware;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Check, catchException, clarifyFetchFailed, createExceptionByStatusCode, throwException, validateStatusCode };
|
|
18
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/validate-status-code.ts","../src/create-exception-by-status-code.ts"],"mappings":";;;;KAIY,KAAA,IAAS,GAAA,EAAK,UAAA,KAAe,UAAA;AAAA,iBAEzB,cAAA,CAAe,KAAA,EAAO,KAAA,GAAQ,aAAA;;;iBCF9B,cAAA,CAAe,OAAA,GAAU,CAAA,cAAe,UAAA,SAAmB,aAAA;;;iBCD3D,kBAAA,CAAA,GAAsB,aAAA;;;iBCqBtB,2BAAA,CAA4B,QAAA,EAAU,QAAA,GAAW,KAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/validate-status-code.ts","../src/create-exception-by-status-code.ts","../src/clarify-fetch-failed.ts"],"mappings":";;;;KAIY,KAAA,IAAS,GAAA,EAAK,UAAA,KAAe,UAAA;AAAA,iBAEzB,cAAA,CAAe,KAAA,EAAO,KAAA,GAAQ,aAAA;;;iBCF9B,cAAA,CAAe,OAAA,GAAU,CAAA,cAAe,UAAA,SAAmB,aAAA;;;iBCD3D,kBAAA,CAAA,GAAsB,aAAA;;;iBCqBtB,2BAAA,CAA4B,QAAA,EAAU,QAAA,GAAW,KAAA;;;iBCtBjD,kBAAA,CAAA,GAAsB,aAAA"}
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,30 @@ function validateStatusCode() {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
|
+
//#region src/clarify-fetch-failed.ts
|
|
77
|
+
function clarifyFetchFailed() {
|
|
78
|
+
return async function clarifyFetchFailedMiddleware(ctx, next) {
|
|
79
|
+
try {
|
|
80
|
+
await next();
|
|
81
|
+
} catch (error) {
|
|
82
|
+
throw resolveCause(error);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function resolveCause(error) {
|
|
87
|
+
if (!(error instanceof Error)) return error;
|
|
88
|
+
const causes = [];
|
|
89
|
+
let current = error.cause;
|
|
90
|
+
while (current instanceof Error) {
|
|
91
|
+
causes.push(current.message);
|
|
92
|
+
current = current.cause;
|
|
93
|
+
}
|
|
94
|
+
if (!causes.length) return error;
|
|
95
|
+
return new error.constructor(`${error.message}: ${causes.join(" - ")}`, { cause: error.cause });
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
76
98
|
exports.catchException = catchException;
|
|
99
|
+
exports.clarifyFetchFailed = clarifyFetchFailed;
|
|
77
100
|
exports.createExceptionByStatusCode = createExceptionByStatusCode;
|
|
78
101
|
exports.throwException = throwException;
|
|
79
102
|
exports.validateStatusCode = validateStatusCode;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["BadRequestException","UnauthorizedException","ForbiddenException","NotFoundedException","MethodNotAllowedException","NotAcceptableException","ProxyAuthenticationRequiredException","RequestTimeoutException","ConflictException","PreconditionFailedException","ContentTooLargeException","UriTooLongException","UnsupportedMediaTypeException","ImATeapotException","TooManyRequestsException","RequestException","InternalServerErrorException","NotImplementedException","BadGatewayException","ServiceUnavailableException","GatewayTimeoutException"],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/create-exception-by-status-code.ts","../src/validate-status-code.ts"],"sourcesContent":["import { KeqContext, KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport type Check = (ctx: KeqContext) => Promisable<void>\n\nexport function throwException(check: Check): KeqMiddleware {\n return async function throwException(ctx, next) {\n await next()\n\n await check(ctx)\n }\n}\n","import { KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport function catchException(handler: (e: unknown) => Promisable<void>): KeqMiddleware {\n return async function catchException(ctx, next) {\n try {\n await next()\n } catch (err) {\n await handler(err)\n }\n }\n}\n","import {\n BadGatewayException,\n BadRequestException,\n ConflictException,\n ForbiddenException,\n GatewayTimeoutException,\n InternalServerErrorException,\n NotAcceptableException,\n NotFoundedException,\n PreconditionFailedException,\n RequestException,\n ServiceUnavailableException,\n UnauthorizedException,\n ImATeapotException,\n MethodNotAllowedException,\n UriTooLongException,\n ContentTooLargeException,\n ProxyAuthenticationRequiredException,\n RequestTimeoutException,\n TooManyRequestsException,\n NotImplementedException,\n UnsupportedMediaTypeException,\n} from 'keq'\n\nexport function createExceptionByStatusCode(response: Response): Error {\n const { status, statusText } = response\n\n // 4xx client errors\n if (status >= 400 && status < 500) {\n switch (status) {\n case 400:\n return new BadRequestException(statusText, { response })\n case 401:\n return new UnauthorizedException(statusText, { response })\n case 403:\n return new ForbiddenException(statusText, { response })\n case 404:\n return new NotFoundedException(statusText, { response })\n case 405:\n return new MethodNotAllowedException(statusText, { response })\n case 406:\n return new NotAcceptableException(statusText, { response })\n case 407:\n return new ProxyAuthenticationRequiredException(statusText, { response })\n case 408:\n return new RequestTimeoutException(statusText, { response })\n case 409:\n return new ConflictException(statusText, { response })\n case 412:\n return new PreconditionFailedException(statusText, { response })\n case 413:\n return new ContentTooLargeException(statusText, { response })\n case 414:\n return new UriTooLongException(statusText, { response })\n case 415:\n return new UnsupportedMediaTypeException(statusText, { response })\n case 418:\n return new ImATeapotException(statusText, { response })\n case 429:\n return new TooManyRequestsException(statusText, { response })\n default:\n // Other 4xx errors, don't retry by default\n return new RequestException(status, statusText, { fatal: true, response })\n }\n }\n\n // 5xx server errors\n if (status >= 500) {\n switch (status) {\n case 500:\n return new InternalServerErrorException(statusText, { response })\n case 501:\n return new NotImplementedException(statusText, { response })\n case 502:\n return new BadGatewayException(statusText, { response })\n case 503:\n return new ServiceUnavailableException(statusText, { response })\n case 504:\n return new GatewayTimeoutException(statusText, { response })\n default:\n // Other 5xx errors, retry by default\n return new RequestException(status, statusText, { fatal: false, response })\n }\n }\n\n return new RequestException(status, statusText, { fatal: false, response })\n}\n","import { KeqMiddleware } from 'keq'\nimport { createExceptionByStatusCode } from './create-exception-by-status-code.js'\n\nexport function validateStatusCode(): KeqMiddleware {\n return async function validateStatusCode(context, next) {\n await next()\n\n const response = context.response\n if (!response) return\n\n const { status } = response\n\n // 2xx success status codes - no error\n if (status >= 200 && status < 300) return\n\n // 3xx redirection status codes - no error (handled by fetch)\n if (status >= 300 && status < 400) return\n\n throw createExceptionByStatusCode(response)\n }\n}\n"],"mappings":";;;AAMA,SAAgB,eAAe,OAA6B;AAC1D,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,QAAM,MAAM;AAEZ,QAAM,MAAM,IAAI;;;;;ACNpB,SAAgB,eAAe,SAA0D;AACvF,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,MAAI;AACF,SAAM,MAAM;WACL,KAAK;AACZ,SAAM,QAAQ,IAAI;;;;;;ACexB,SAAgB,4BAA4B,UAA2B;CACrE,MAAM,EAAE,QAAQ,eAAe;AAG/B,KAAI,UAAU,OAAO,SAAS,IAC5B,SAAQ,QAAR;EACE,KAAK,IACH,QAAO,IAAIA,IAAAA,oBAAoB,YAAY,EAAE,UAAU,CAAC;EAC1D,KAAK,IACH,QAAO,IAAIC,IAAAA,sBAAsB,YAAY,EAAE,UAAU,CAAC;EAC5D,KAAK,IACH,QAAO,IAAIC,IAAAA,mBAAmB,YAAY,EAAE,UAAU,CAAC;EACzD,KAAK,IACH,QAAO,IAAIC,IAAAA,oBAAoB,YAAY,EAAE,UAAU,CAAC;EAC1D,KAAK,IACH,QAAO,IAAIC,IAAAA,0BAA0B,YAAY,EAAE,UAAU,CAAC;EAChE,KAAK,IACH,QAAO,IAAIC,IAAAA,uBAAuB,YAAY,EAAE,UAAU,CAAC;EAC7D,KAAK,IACH,QAAO,IAAIC,IAAAA,qCAAqC,YAAY,EAAE,UAAU,CAAC;EAC3E,KAAK,IACH,QAAO,IAAIC,IAAAA,wBAAwB,YAAY,EAAE,UAAU,CAAC;EAC9D,KAAK,IACH,QAAO,IAAIC,IAAAA,kBAAkB,YAAY,EAAE,UAAU,CAAC;EACxD,KAAK,I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SAAS,IAAK;AAGnC,MAAI,UAAU,OAAO,SAAS,IAAK;AAEnC,QAAM,4BAA4B,SAAS"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["BadRequestException","UnauthorizedException","ForbiddenException","NotFoundedException","MethodNotAllowedException","NotAcceptableException","ProxyAuthenticationRequiredException","RequestTimeoutException","ConflictException","PreconditionFailedException","ContentTooLargeException","UriTooLongException","UnsupportedMediaTypeException","ImATeapotException","TooManyRequestsException","RequestException","InternalServerErrorException","NotImplementedException","BadGatewayException","ServiceUnavailableException","GatewayTimeoutException"],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/create-exception-by-status-code.ts","../src/validate-status-code.ts","../src/clarify-fetch-failed.ts"],"sourcesContent":["import { KeqContext, KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport type Check = (ctx: KeqContext) => Promisable<void>\n\nexport function throwException(check: Check): KeqMiddleware {\n return async function throwException(ctx, next) {\n await next()\n\n await check(ctx)\n }\n}\n","import { KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport function catchException(handler: (e: unknown) => Promisable<void>): KeqMiddleware {\n return async function catchException(ctx, next) {\n try {\n await next()\n } catch (err) {\n await handler(err)\n }\n }\n}\n","import {\n BadGatewayException,\n BadRequestException,\n ConflictException,\n ForbiddenException,\n GatewayTimeoutException,\n InternalServerErrorException,\n NotAcceptableException,\n NotFoundedException,\n PreconditionFailedException,\n RequestException,\n ServiceUnavailableException,\n UnauthorizedException,\n ImATeapotException,\n MethodNotAllowedException,\n UriTooLongException,\n ContentTooLargeException,\n ProxyAuthenticationRequiredException,\n RequestTimeoutException,\n TooManyRequestsException,\n NotImplementedException,\n UnsupportedMediaTypeException,\n} from 'keq'\n\nexport function createExceptionByStatusCode(response: Response): Error {\n const { status, statusText } = response\n\n // 4xx client errors\n if (status >= 400 && status < 500) {\n switch (status) {\n case 400:\n return new BadRequestException(statusText, { response })\n case 401:\n return new UnauthorizedException(statusText, { response })\n case 403:\n return new ForbiddenException(statusText, { response })\n case 404:\n return new NotFoundedException(statusText, { response })\n case 405:\n return new MethodNotAllowedException(statusText, { response })\n case 406:\n return new NotAcceptableException(statusText, { response })\n case 407:\n return new ProxyAuthenticationRequiredException(statusText, { response })\n case 408:\n return new RequestTimeoutException(statusText, { response })\n case 409:\n return new ConflictException(statusText, { response })\n case 412:\n return new PreconditionFailedException(statusText, { response })\n case 413:\n return new ContentTooLargeException(statusText, { response })\n case 414:\n return new UriTooLongException(statusText, { response })\n case 415:\n return new UnsupportedMediaTypeException(statusText, { response })\n case 418:\n return new ImATeapotException(statusText, { response })\n case 429:\n return new TooManyRequestsException(statusText, { response })\n default:\n // Other 4xx errors, don't retry by default\n return new RequestException(status, statusText, { fatal: true, response })\n }\n }\n\n // 5xx server errors\n if (status >= 500) {\n switch (status) {\n case 500:\n return new InternalServerErrorException(statusText, { response })\n case 501:\n return new NotImplementedException(statusText, { response })\n case 502:\n return new BadGatewayException(statusText, { response })\n case 503:\n return new ServiceUnavailableException(statusText, { response })\n case 504:\n return new GatewayTimeoutException(statusText, { response })\n default:\n // Other 5xx errors, retry by default\n return new RequestException(status, statusText, { fatal: false, response })\n }\n }\n\n return new RequestException(status, statusText, { fatal: false, response })\n}\n","import { KeqMiddleware } from 'keq'\nimport { createExceptionByStatusCode } from './create-exception-by-status-code.js'\n\nexport function validateStatusCode(): KeqMiddleware {\n return async function validateStatusCode(context, next) {\n await next()\n\n const response = context.response\n if (!response) return\n\n const { status } = response\n\n // 2xx success status codes - no error\n if (status >= 200 && status < 300) return\n\n // 3xx redirection status codes - no error (handled by fetch)\n if (status >= 300 && status < 400) return\n\n throw createExceptionByStatusCode(response)\n }\n}\n","import type { KeqMiddleware } from 'keq'\n\nexport function clarifyFetchFailed(): KeqMiddleware {\n return async function clarifyFetchFailedMiddleware(ctx, next) {\n try {\n await next()\n } catch (error) {\n throw resolveCause(error)\n }\n }\n}\n\nfunction resolveCause(error: unknown): unknown {\n if (!(error instanceof Error)) return error\n\n const causes: string[] = []\n let current: unknown = error.cause\n while (current instanceof Error) {\n causes.push(current.message)\n current = current.cause\n }\n\n if (!causes.length) return error\n\n const enhanced = new (error.constructor as new (message: string, options?: { cause?: unknown }) => Error)(\n `${error.message}: ${causes.join(' - ')}`,\n { cause: error.cause },\n )\n return enhanced\n}\n"],"mappings":";;;AAMA,SAAgB,eAAe,OAA6B;AAC1D,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,QAAM,MAAM;AAEZ,QAAM,MAAM,IAAI;;;;;ACNpB,SAAgB,eAAe,SAA0D;AACvF,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,MAAI;AACF,SAAM,MAAM;WACL,KAAK;AACZ,SAAM,QAAQ,IAAI;;;;;;ACexB,SAAgB,4BAA4B,UAA2B;CACrE,MAAM,EAAE,QAAQ,eAAe;AAG/B,KAAI,UAAU,OAAO,SAAS,IAC5B,SAAQ,QAAR;EACE,KAAK,IACH,QAAO,IAAIA,IAAAA,oBAAoB,YAAY,EAAE,UAAU,CAAC;EAC1D,KAAK,IACH,QAAO,IAAIC,IAAAA,sBAAsB,YAAY,EAAE,UAAU,CAAC;EAC5D,KAAK,IACH,QAAO,IAAIC,IAAAA,mBAAmB,YAAY,EAAE,UAAU,CAAC;EACzD,KAAK,IACH,QAAO,IAAIC,IAAAA,oBAAoB,YAAY,EAAE,UAAU,CAAC;EAC1D,KAAK,IACH,QAAO,IAAIC,IAAAA,0BAA0B,YAAY,EAAE,UAAU,CAAC;EAChE,KAAK,IACH,QAAO,IAAIC,IAAAA,uBAAuB,YAAY,EAAE,UAAU,CAAC;EAC7D,KAAK,IACH,QAAO,IAAIC,IAAAA,qCAAqC,YAAY,EAAE,UAAU,CAAC;EAC3E,KAAK,IACH,QAAO,IAAIC,IAAAA,wBAAwB,YAAY,EAAE,UAAU,CAAC;EAC9D,KAAK,IACH,QAAO,IAAIC,IAAAA,kBAAkB,YAAY,EAAE,UAAU,CAAC;EACxD,KAAK,IACH,QAAO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AK;AAGnC,MAAI,UAAU,OAAO,SAAS,IAAK;AAEnC,QAAM,4BAA4B,SAAS;;;;;AChB/C,SAAgB,qBAAoC;AAClD,QAAO,eAAe,6BAA6B,KAAK,MAAM;AAC5D,MAAI;AACF,SAAM,MAAM;WACL,OAAO;AACd,SAAM,aAAa,MAAM;;;;AAK/B,SAAS,aAAa,OAAyB;AAC7C,KAAI,EAAE,iBAAiB,OAAQ,QAAO;CAEtC,MAAM,SAAmB,EAAE;CAC3B,IAAI,UAAmB,MAAM;AAC7B,QAAO,mBAAmB,OAAO;AAC/B,SAAO,KAAK,QAAQ,QAAQ;AAC5B,YAAU,QAAQ;;AAGpB,KAAI,CAAC,OAAO,OAAQ,QAAO;AAM3B,QAAO,IAJe,MAAM,YAC1B,GAAG,MAAM,QAAQ,IAAI,OAAO,KAAK,MAAM,IACvC,EAAE,OAAO,MAAM,OAAO,CAET"}
|
package/dist/index.mjs
CHANGED
|
@@ -72,6 +72,28 @@ function validateStatusCode() {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
|
-
|
|
75
|
+
//#region src/clarify-fetch-failed.ts
|
|
76
|
+
function clarifyFetchFailed() {
|
|
77
|
+
return async function clarifyFetchFailedMiddleware(ctx, next) {
|
|
78
|
+
try {
|
|
79
|
+
await next();
|
|
80
|
+
} catch (error) {
|
|
81
|
+
throw resolveCause(error);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function resolveCause(error) {
|
|
86
|
+
if (!(error instanceof Error)) return error;
|
|
87
|
+
const causes = [];
|
|
88
|
+
let current = error.cause;
|
|
89
|
+
while (current instanceof Error) {
|
|
90
|
+
causes.push(current.message);
|
|
91
|
+
current = current.cause;
|
|
92
|
+
}
|
|
93
|
+
if (!causes.length) return error;
|
|
94
|
+
return new error.constructor(`${error.message}: ${causes.join(" - ")}`, { cause: error.cause });
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { catchException, clarifyFetchFailed, createExceptionByStatusCode, throwException, validateStatusCode };
|
|
76
98
|
|
|
77
99
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/create-exception-by-status-code.ts","../src/validate-status-code.ts"],"sourcesContent":["import { KeqContext, KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport type Check = (ctx: KeqContext) => Promisable<void>\n\nexport function throwException(check: Check): KeqMiddleware {\n return async function throwException(ctx, next) {\n await next()\n\n await check(ctx)\n }\n}\n","import { KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport function catchException(handler: (e: unknown) => Promisable<void>): KeqMiddleware {\n return async function catchException(ctx, next) {\n try {\n await next()\n } catch (err) {\n await handler(err)\n }\n }\n}\n","import {\n BadGatewayException,\n BadRequestException,\n ConflictException,\n ForbiddenException,\n GatewayTimeoutException,\n InternalServerErrorException,\n NotAcceptableException,\n NotFoundedException,\n PreconditionFailedException,\n RequestException,\n ServiceUnavailableException,\n UnauthorizedException,\n ImATeapotException,\n MethodNotAllowedException,\n UriTooLongException,\n ContentTooLargeException,\n ProxyAuthenticationRequiredException,\n RequestTimeoutException,\n TooManyRequestsException,\n NotImplementedException,\n UnsupportedMediaTypeException,\n} from 'keq'\n\nexport function createExceptionByStatusCode(response: Response): Error {\n const { status, statusText } = response\n\n // 4xx client errors\n if (status >= 400 && status < 500) {\n switch (status) {\n case 400:\n return new BadRequestException(statusText, { response })\n case 401:\n return new UnauthorizedException(statusText, { response })\n case 403:\n return new ForbiddenException(statusText, { response })\n case 404:\n return new NotFoundedException(statusText, { response })\n case 405:\n return new MethodNotAllowedException(statusText, { response })\n case 406:\n return new NotAcceptableException(statusText, { response })\n case 407:\n return new ProxyAuthenticationRequiredException(statusText, { response })\n case 408:\n return new RequestTimeoutException(statusText, { response })\n case 409:\n return new ConflictException(statusText, { response })\n case 412:\n return new PreconditionFailedException(statusText, { response })\n case 413:\n return new ContentTooLargeException(statusText, { response })\n case 414:\n return new UriTooLongException(statusText, { response })\n case 415:\n return new UnsupportedMediaTypeException(statusText, { response })\n case 418:\n return new ImATeapotException(statusText, { response })\n case 429:\n return new TooManyRequestsException(statusText, { response })\n default:\n // Other 4xx errors, don't retry by default\n return new RequestException(status, statusText, { fatal: true, response })\n }\n }\n\n // 5xx server errors\n if (status >= 500) {\n switch (status) {\n case 500:\n return new InternalServerErrorException(statusText, { response })\n case 501:\n return new NotImplementedException(statusText, { response })\n case 502:\n return new BadGatewayException(statusText, { response })\n case 503:\n return new ServiceUnavailableException(statusText, { response })\n case 504:\n return new GatewayTimeoutException(statusText, { response })\n default:\n // Other 5xx errors, retry by default\n return new RequestException(status, statusText, { fatal: false, response })\n }\n }\n\n return new RequestException(status, statusText, { fatal: false, response })\n}\n","import { KeqMiddleware } from 'keq'\nimport { createExceptionByStatusCode } from './create-exception-by-status-code.js'\n\nexport function validateStatusCode(): KeqMiddleware {\n return async function validateStatusCode(context, next) {\n await next()\n\n const response = context.response\n if (!response) return\n\n const { status } = response\n\n // 2xx success status codes - no error\n if (status >= 200 && status < 300) return\n\n // 3xx redirection status codes - no error (handled by fetch)\n if (status >= 300 && status < 400) return\n\n throw createExceptionByStatusCode(response)\n }\n}\n"],"mappings":";;AAMA,SAAgB,eAAe,OAA6B;AAC1D,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,QAAM,MAAM;AAEZ,QAAM,MAAM,IAAI;;;;;ACNpB,SAAgB,eAAe,SAA0D;AACvF,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,MAAI;AACF,SAAM,MAAM;WACL,KAAK;AACZ,SAAM,QAAQ,IAAI;;;;;;ACexB,SAAgB,4BAA4B,UAA2B;CACrE,MAAM,EAAE,QAAQ,eAAe;AAG/B,KAAI,UAAU,OAAO,SAAS,IAC5B,SAAQ,QAAR;EACE,KA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AK,IACH,QAAO,IAAI,4BAA4B,YAAY,EAAE,UAAU,CAAC;EAClE,KAAK,IACH,QAAO,IAAI,wBAAwB,YAAY,EAAE,UAAU,CAAC;EAC9D,QAEE,QAAO,IAAI,iBAAiB,QAAQ,YAAY;GAAE,OAAO;GAAO;GAAU,CAAC;;AAIjF,QAAO,IAAI,iBAAiB,QAAQ,YAAY;EAAE,OAAO;EAAO;EAAU,CAAC;;;;AClF7E,SAAgB,qBAAoC;AAClD,QAAO,eAAe,mBAAmB,SAAS,MAAM;AACtD,QAAM,MAAM;EAEZ,MAAM,WAAW,QAAQ;AACzB,MAAI,CAAC,SAAU;EAEf,MAAM,EAAE,WAAW;AAGnB,MAAI,UAAU,OAAO,SAAS,IAAK;AAGnC,MAAI,UAAU,OAAO,SAAS,IAAK;AAEnC,QAAM,4BAA4B,SAAS"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/throw-exception.ts","../src/catch-exception.ts","../src/create-exception-by-status-code.ts","../src/validate-status-code.ts","../src/clarify-fetch-failed.ts"],"sourcesContent":["import { KeqContext, KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport type Check = (ctx: KeqContext) => Promisable<void>\n\nexport function throwException(check: Check): KeqMiddleware {\n return async function throwException(ctx, next) {\n await next()\n\n await check(ctx)\n }\n}\n","import { KeqMiddleware } from 'keq'\nimport { Promisable } from 'type-fest'\n\n\nexport function catchException(handler: (e: unknown) => Promisable<void>): KeqMiddleware {\n return async function catchException(ctx, next) {\n try {\n await next()\n } catch (err) {\n await handler(err)\n }\n }\n}\n","import {\n BadGatewayException,\n BadRequestException,\n ConflictException,\n ForbiddenException,\n GatewayTimeoutException,\n InternalServerErrorException,\n NotAcceptableException,\n NotFoundedException,\n PreconditionFailedException,\n RequestException,\n ServiceUnavailableException,\n UnauthorizedException,\n ImATeapotException,\n MethodNotAllowedException,\n UriTooLongException,\n ContentTooLargeException,\n ProxyAuthenticationRequiredException,\n RequestTimeoutException,\n TooManyRequestsException,\n NotImplementedException,\n UnsupportedMediaTypeException,\n} from 'keq'\n\nexport function createExceptionByStatusCode(response: Response): Error {\n const { status, statusText } = response\n\n // 4xx client errors\n if (status >= 400 && status < 500) {\n switch (status) {\n case 400:\n return new BadRequestException(statusText, { response })\n case 401:\n return new UnauthorizedException(statusText, { response })\n case 403:\n return new ForbiddenException(statusText, { response })\n case 404:\n return new NotFoundedException(statusText, { response })\n case 405:\n return new MethodNotAllowedException(statusText, { response })\n case 406:\n return new NotAcceptableException(statusText, { response })\n case 407:\n return new ProxyAuthenticationRequiredException(statusText, { response })\n case 408:\n return new RequestTimeoutException(statusText, { response })\n case 409:\n return new ConflictException(statusText, { response })\n case 412:\n return new PreconditionFailedException(statusText, { response })\n case 413:\n return new ContentTooLargeException(statusText, { response })\n case 414:\n return new UriTooLongException(statusText, { response })\n case 415:\n return new UnsupportedMediaTypeException(statusText, { response })\n case 418:\n return new ImATeapotException(statusText, { response })\n case 429:\n return new TooManyRequestsException(statusText, { response })\n default:\n // Other 4xx errors, don't retry by default\n return new RequestException(status, statusText, { fatal: true, response })\n }\n }\n\n // 5xx server errors\n if (status >= 500) {\n switch (status) {\n case 500:\n return new InternalServerErrorException(statusText, { response })\n case 501:\n return new NotImplementedException(statusText, { response })\n case 502:\n return new BadGatewayException(statusText, { response })\n case 503:\n return new ServiceUnavailableException(statusText, { response })\n case 504:\n return new GatewayTimeoutException(statusText, { response })\n default:\n // Other 5xx errors, retry by default\n return new RequestException(status, statusText, { fatal: false, response })\n }\n }\n\n return new RequestException(status, statusText, { fatal: false, response })\n}\n","import { KeqMiddleware } from 'keq'\nimport { createExceptionByStatusCode } from './create-exception-by-status-code.js'\n\nexport function validateStatusCode(): KeqMiddleware {\n return async function validateStatusCode(context, next) {\n await next()\n\n const response = context.response\n if (!response) return\n\n const { status } = response\n\n // 2xx success status codes - no error\n if (status >= 200 && status < 300) return\n\n // 3xx redirection status codes - no error (handled by fetch)\n if (status >= 300 && status < 400) return\n\n throw createExceptionByStatusCode(response)\n }\n}\n","import type { KeqMiddleware } from 'keq'\n\nexport function clarifyFetchFailed(): KeqMiddleware {\n return async function clarifyFetchFailedMiddleware(ctx, next) {\n try {\n await next()\n } catch (error) {\n throw resolveCause(error)\n }\n }\n}\n\nfunction resolveCause(error: unknown): unknown {\n if (!(error instanceof Error)) return error\n\n const causes: string[] = []\n let current: unknown = error.cause\n while (current instanceof Error) {\n causes.push(current.message)\n current = current.cause\n }\n\n if (!causes.length) return error\n\n const enhanced = new (error.constructor as new (message: string, options?: { cause?: unknown }) => Error)(\n `${error.message}: ${causes.join(' - ')}`,\n { cause: error.cause },\n )\n return enhanced\n}\n"],"mappings":";;AAMA,SAAgB,eAAe,OAA6B;AAC1D,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,QAAM,MAAM;AAEZ,QAAM,MAAM,IAAI;;;;;ACNpB,SAAgB,eAAe,SAA0D;AACvF,QAAO,eAAe,eAAe,KAAK,MAAM;AAC9C,MAAI;AACF,SAAM,MAAM;WACL,KAAK;AACZ,SAAM,QAAQ,IAAI;;;;;;ACexB,SAAgB,4BAA4B,UAA2B;CACrE,MAAM,EAAE,QAAQ,eAAe;AAG/B,KAAI,UAAU,OAAO,SAAS,IAC5B,SAAQ,QAAR;EACE,KAAK,IACH,QAAO,IAAI,oBAAoB,YAAY,EAAE,UAAU,CAAC;EAC1D,KAAK,IACH,QAAO,IAAI,sBAAsB,YAAY,EAAE,UAAU,CAAC;EAC5D,KAAK,IACH,QAAO,IAAI,mBAAmB,YAAY,EAAE,UAAU,CAAC;EACzD,KAAK,IACH,QAAO,IAAI,oBAAoB,YAAY,EAAE,UAAU,CAAC;EAC1D,KAAK,IACH,QAAO,IAAI,0BAA0B,YAAY,EAAE,UAAU,CAAC;EAChE,KAAK,IACH,QAAO,IAAI,uBAAuB,YAAY,EAAE,UAAU,CAAC;EAC7D,KAAK,IACH,QAAO,IAAI,qCAAqC,YAAY,EAAE,UAAU,CAAC;EAC3E,KAAK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U,OAAO,SAAS,IAAK;AAGnC,MAAI,UAAU,OAAO,SAAS,IAAK;AAEnC,QAAM,4BAA4B,SAAS;;;;;AChB/C,SAAgB,qBAAoC;AAClD,QAAO,eAAe,6BAA6B,KAAK,MAAM;AAC5D,MAAI;AACF,SAAM,MAAM;WACL,OAAO;AACd,SAAM,aAAa,MAAM;;;;AAK/B,SAAS,aAAa,OAAyB;AAC7C,KAAI,EAAE,iBAAiB,OAAQ,QAAO;CAEtC,MAAM,SAAmB,EAAE;CAC3B,IAAI,UAAmB,MAAM;AAC7B,QAAO,mBAAmB,OAAO;AAC/B,SAAO,KAAK,QAAQ,QAAQ;AAC5B,YAAU,QAAQ;;AAGpB,KAAI,CAAC,OAAO,OAAQ,QAAO;AAM3B,QAAO,IAJe,MAAM,YAC1B,GAAG,MAAM,QAAQ,IAAI,OAAO,KAAK,MAAM,IACvC,EAAE,OAAO,MAAM,OAAO,CAET"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keq-request/exception",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.8",
|
|
4
4
|
"description": "Request exception for keq",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"keq",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@scalar/openapi-types": "^0.8.0",
|
|
41
41
|
"@types/node": "^20.19.39",
|
|
42
|
-
"
|
|
43
|
-
"keq": "5.0.0-beta.
|
|
42
|
+
"keq": "5.0.0-beta.8",
|
|
43
|
+
"@keq-request/cli": "5.0.0-beta.8"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"keq": "^5.0.0-beta.
|
|
46
|
+
"keq": "^5.0.0-beta.8"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@keq-request/cli": "5.0.0-beta.
|
|
49
|
+
"@keq-request/cli": "5.0.0-beta.8"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsdown",
|