@smithy/service-error-classification
Advanced tools
Comparing version 3.0.10 to 3.0.11
@@ -73,5 +73,5 @@ var __defProp = Object.defineProperty; | ||
}, "isThrottlingError"); | ||
var isTransientError = /* @__PURE__ */ __name((error) => { | ||
var isTransientError = /* @__PURE__ */ __name((error, depth = 0) => { | ||
var _a; | ||
return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0); | ||
return isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes((error == null ? void 0 : error.code) || "") || TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) == null ? void 0 : _a.httpStatusCode) || 0) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1); | ||
}, "isTransientError"); | ||
@@ -78,0 +78,0 @@ var isServerError = /* @__PURE__ */ __name((error) => { |
@@ -8,6 +8,7 @@ import { CLOCK_SKEW_ERROR_CODES, NODEJS_TIMEOUT_ERROR_CODES, THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, } from "./constants"; | ||
error.$retryable?.throttling == true; | ||
export const isTransientError = (error) => isClockSkewCorrectedError(error) || | ||
export const isTransientError = (error, depth = 0) => isClockSkewCorrectedError(error) || | ||
TRANSIENT_ERROR_CODES.includes(error.name) || | ||
NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || | ||
TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0); | ||
TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || | ||
(error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1)); | ||
export const isServerError = (error) => { | ||
@@ -14,0 +15,0 @@ if (error.$metadata?.httpStatusCode !== undefined) { |
@@ -18,3 +18,3 @@ import { SdkError } from "@smithy/types"; | ||
*/ | ||
export declare const isTransientError: (error: SdkError) => boolean; | ||
export declare const isTransientError: (error: SdkError, depth?: number) => boolean; | ||
export declare const isServerError: (error: SdkError) => boolean; |
@@ -18,3 +18,3 @@ import { SdkError } from "@smithy/types"; | ||
*/ | ||
export declare const isTransientError: (error: SdkError) => boolean; | ||
export declare const isTransientError: (error: SdkError, depth?: number) => boolean; | ||
export declare const isServerError: (error: SdkError) => boolean; |
{ | ||
"name": "@smithy/service-error-classification", | ||
"version": "3.0.10", | ||
"version": "3.0.11", | ||
"scripts": { | ||
@@ -57,4 +57,4 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'", | ||
"dependencies": { | ||
"@smithy/types": "^3.7.1" | ||
"@smithy/types": "^3.7.2" | ||
} | ||
} |
23367
233
Updated@smithy/types@^3.7.2