I'm new in the world of Ethereum and I'm building a app with node.js.
I'm using web3 1.0 and infura to connect to a contract and get all the logs for different events. I'm using the "getPastEvents" function from web3.
I'm getting this error time to time "Invalid JSON RPC response".
Right now, when I get this error, I just restart the app and if it passes good if not well i restart again... I'm putting a setTimout function so my app restart by itself. But because of that error, my app is crashing and doing an exit.
How can I handle this error ? any suggestion will be very appreciated.