Skip to content

Commit

Permalink
documenting infura's error
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed Dec 21, 2023
1 parent 52057c1 commit f39ea71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/web3/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const getEvents = async (
}

// Infura returns 'more than 10000 results' error if block range is too wide
// in a format like this: [0x1a2b3c4d5e6f7, 0x1a2b3c4d5e6f7]
// error format:
// "query returned more than 10000 results. Try with this block range [0x30CE171, 0x30CE1C9]."
if (e.includes && e.includes('query returned more than 10000 results')) {
const range = e
.match(/\[([0-9a-fA-F, x]+)\]/)
Expand Down

0 comments on commit f39ea71

Please sign in to comment.