I have a smart contract inside which I have used Oraclize to get current time stamp. On few occasions the Oraclize callback fails due to out of Gas exception. How can one catch this failure and display error message on my dapp front end?
I tried below options :
- Monitor an event to catch if Oraclize returns any value or not. In my case it returns the current time stamp and moves ahead to logic inside the callback function. So here I could not catch the exception.
- Monitor a second event which is triggered when computations using the timestamp returned by Oraclize are complete. Here also I am unable to catch the exception as it runs out of gas before reaching the logic to trigger the success event.
As per my understanding the out of gas exception happens in between the above two events i.e. after sending value and before completing the processing it looses all the gas.
Please help to suggest what is the preferred way to handle this error and communicate to user on the frond end.