diff --git a/packages/middleware-retry/src/retryDecider.ts b/packages/middleware-retry/src/retryDecider.ts index 221ef3d27607..2d8e7b9fc390 100644 --- a/packages/middleware-retry/src/retryDecider.ts +++ b/packages/middleware-retry/src/retryDecider.ts @@ -1,7 +1,6 @@ import { RETRYABLE_STATUS_CODES } from "./constants"; import { isClockSkewError, - isStillProcessingError, isThrottlingError } from "@aws-sdk/service-error-classification"; import { MetadataBearer, SdkError } from "@aws-sdk/types"; @@ -23,11 +22,7 @@ export const defaultRetryDecider = (error: SdkError) => { return true; } - return ( - isStillProcessingError(error) || - isThrottlingError(error) || - isClockSkewError(error) - ); + return isThrottlingError(error) || isClockSkewError(error); }; function hasMetadata(error: any): error is MetadataBearer { diff --git a/packages/service-error-classification/src/constants.ts b/packages/service-error-classification/src/constants.ts index c7f91e394a36..755f54be5172 100644 --- a/packages/service-error-classification/src/constants.ts +++ b/packages/service-error-classification/src/constants.ts @@ -14,25 +14,24 @@ export const CLOCK_SKEW_ERROR_CODES = [ "SignatureDoesNotMatch" ]; -/** - * Errors encountered when the state presumed by an operation is not yet ready. - */ -export const STILL_PROCESSING_ERROR_CODES = ["PriorRequestNotComplete"]; - /** * Errors that indicate the SDK is being throttled. * * These errors are always retryable. */ export const THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", + "Throttling", + "ThrottlingException", + "ThrottledException", + "RequestThrottledException", + "TooManyRequestsException", "ProvisionedThroughputExceededException", + "TransactionInProgressException", "RequestLimitExceeded", + "BandwidthLimitExceeded", + "LimitExceededException", "RequestThrottled", - "RequestThrottledException", "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException" + "PriorRequestNotComplete", + "EC2ThrottledException" ]; diff --git a/packages/service-error-classification/src/index.spec.ts b/packages/service-error-classification/src/index.spec.ts index 636392936ec5..5a75c0fd3633 100644 --- a/packages/service-error-classification/src/index.spec.ts +++ b/packages/service-error-classification/src/index.spec.ts @@ -1,13 +1,5 @@ -import { - CLOCK_SKEW_ERROR_CODES, - STILL_PROCESSING_ERROR_CODES, - THROTTLING_ERROR_CODES -} from "./constants"; -import { - isClockSkewError, - isStillProcessingError, - isThrottlingError -} from "./index"; +import { CLOCK_SKEW_ERROR_CODES, THROTTLING_ERROR_CODES } from "./constants"; +import { isClockSkewError, isThrottlingError } from "./index"; const checkForErrorType = ( isErrorTypeFunc: (error: Error) => boolean, @@ -37,24 +29,6 @@ describe("isClockSkewError", () => { } }); -describe("isStillProcessingError", () => { - STILL_PROCESSING_ERROR_CODES.forEach(name => { - it(`should declare error with the name "${name}" to be a StillProcessing error`, () => { - checkForErrorType(isStillProcessingError, name, true); - }); - }); - - while (true) { - const name = Math.random().toString(36).substring(2); - if (!STILL_PROCESSING_ERROR_CODES.includes(name)) { - it(`should not declare error with the name "${name}" to be a StillProcessing error`, () => { - checkForErrorType(isStillProcessingError, name, false); - }); - break; - } - } -}); - describe("isThrottlingError", () => { THROTTLING_ERROR_CODES.forEach(name => { it(`should declare error with the name "${name}" to be a Throttling error`, () => { diff --git a/packages/service-error-classification/src/index.ts b/packages/service-error-classification/src/index.ts index 4a2125a76509..558ea92c589b 100644 --- a/packages/service-error-classification/src/index.ts +++ b/packages/service-error-classification/src/index.ts @@ -1,14 +1,7 @@ -import { - CLOCK_SKEW_ERROR_CODES, - STILL_PROCESSING_ERROR_CODES, - THROTTLING_ERROR_CODES -} from "./constants"; +import { CLOCK_SKEW_ERROR_CODES, THROTTLING_ERROR_CODES } from "./constants"; export const isClockSkewError = (error: Error) => CLOCK_SKEW_ERROR_CODES.includes(error.name); -export const isStillProcessingError = (error: Error) => - STILL_PROCESSING_ERROR_CODES.includes(error.name); - export const isThrottlingError = (error: Error) => THROTTLING_ERROR_CODES.includes(error.name);