-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle errors in getLatestBlock #1649
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be clear this doesn't solve the issue of the subgraph not syncing error because if we return null then we will display that message. which is probably a correct message to show?
When we return null the entire iteration is aborted. We do nothing. (This is commented in the code) |
@@ -126,7 +134,7 @@ export async function initializeArc(provider?: any): Promise<boolean> { | |||
const retryLink = new RetryLink({ | |||
attempts: { | |||
max: 5, | |||
retryIf: (error, _operation) => { | |||
retryIf: (error, _operation) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change ? how the linter did not catch that before..is it catching that at all?
if linter does not care about so leave these update for other "lint": pr.. it is difficult to review with all these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- On this github page you can tell the github to ignore whitespage differences
- I already created a separate PR to make the linter catch these: lint: eliminate redundant multiple spaces #1650
const curBlock = (await getCurrentBlock()).number; | ||
const curBlock = (await getCurrentBlock())?.number; | ||
if (curBlock === undefined) { | ||
return; // try again next time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe log something to the console..here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (in getCurrentBlock)
Resolves: #1648
Mainly to the error: "connection not open on send()" in
web3.eth.getBlock("latest")
See: web3/web3.js#1354