@@ -12,6 +12,8 @@ import protocol SmithyRetriesAPI.RetryErrorInfoProvider
1212import struct Foundation. TimeInterval
1313import class Foundation. NSError
1414import var Foundation. NSURLErrorDomain
15+ import struct AwsCommonRuntimeKit. CRTError
16+ import enum AwsCommonRuntimeKit. CommonRunTimeError
1517
1618public enum DefaultRetryErrorInfoProvider : RetryErrorInfoProvider , Sendable {
1719 /// Returns information used to determine how & if to retry an error.
@@ -41,6 +43,21 @@ public enum DefaultRetryErrorInfoProvider: RetryErrorInfoProvider, Sendable {
4143 // NSURLErrorTimedOut = -1001
4244 // "The request timed out."
4345 return . init( errorType: . transient, retryAfterHint: nil , isTimeout: true )
46+ } else if let crtError = error as? CommonRunTimeError ,
47+ case . crtError( let crtErrorStruct) = crtError,
48+ crtErrorStruct. code == 1051 {
49+ // Retries CRTError(code: 1051, message: "socket is closed.", name: "AWS_IO_SOCKET_CLOSED"))
50+ return . init( errorType: . transient, retryAfterHint: nil , isTimeout: false )
51+ } else if let crtError = error as? CommonRunTimeError ,
52+ case . crtError( let crtErrorStruct) = crtError,
53+ crtErrorStruct. code == 1048 {
54+ // Retries CRTError(code: 1048, message: "socket operation timed out.", name: "AWS_IO_SOCKET_TIMEOUT"))
55+ return . init( errorType: . transient, retryAfterHint: nil , isTimeout: true )
56+ } else if let crtError = error as? CommonRunTimeError ,
57+ case . crtError( let crtErrorStruct) = crtError,
58+ crtErrorStruct. code == 1067 {
59+ // Retries CRTError(code: 1067, message: "Channel shutdown due to tls negotiation timeout", name: "AWS_IO_TLS_NEGOTIATION_TIMEOUT"))
60+ return . init( errorType: . transient, retryAfterHint: nil , isTimeout: true )
4461 }
4562 return nil
4663 }
0 commit comments