File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66// TODO: browser connection timeouts will have different error messages, but we need to wait for them to occur in order
77// to find out what they are
88function isTimeout ( e : Error ) {
9- return e . message . includes ( "AWS_IO_TLS_NEGOTIATION_TIMEOUT" ) || e . message . includes ( "AWS_IO_SOCKET_TIMEOUT" ) ;
9+ return e . message . includes ( "AWS_IO_TLS_NEGOTIATION_TIMEOUT" ) ||
10+ e . message . includes ( "AWS_IO_SOCKET_TIMEOUT" ) ||
11+ e . message . includes ( "AWS_IO_DNS_INVALID_NAME" ) ;
1012}
1113
1214export async function basicRetryWrapper ( maxAttempts : number , isRetryablePredicate : ( err : Error ) => boolean , testFunction : ( ) => Promise < void > ) : Promise < void > {
@@ -20,6 +22,9 @@ export async function basicRetryWrapper(maxAttempts: number, isRetryablePredicat
2022 if ( ! isRetryablePredicate ( e as Error ) || attempt >= maxAttempts ) {
2123 throw e ;
2224 }
25+
26+ // pause for a second before retrying
27+ await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
2328 }
2429 }
2530}
You can’t perform that action at this time.
0 commit comments