Skip to content

Commit

Permalink
Retry on "Failed to fetch" error
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Mar 6, 2021
1 parent 1c824e0 commit 126bd3d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions lib/providers/json-rpc-provider.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions lib/providers/json-rpc-provider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/utils/web.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/utils/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function fetchJson(connection: string | ConnectionInfo, json?: stri
}
return response;
} catch (error) {
if (error.toString().includes('FetchError')) {
if (error.toString().includes('FetchError') || error.toString().includes('Failed to fetch')) {
console.warn(`Retrying HTTP request for ${url} because of error: ${error}`);
return null;
}
Expand Down

0 comments on commit 126bd3d

Please sign in to comment.