This repo contains multiple examples to handle RPC errors when sending requests to blockchain nodes.
Use can wrap the RPC requests in a method and use Promise.all, Promise.race or Promise.any.
We can wrap the RPC request in a method that catches any error and use recursion to make the retries.
A modification of the previous one, just adding a delay between each retry
The retries are done using a different provider that users a different RPC endpoint.
Another wrapper function used to invoke smart contract methods, catch any errors and retry using a different provider and RPC endpoint.