optimism
optimism copied to clipboard
Boba Gateway - improve error handling and reporting of errors to ERROR_TRACKING_SERVICE
This is a longer term issue. Transactions can fail at many places for many different reasons - at the level of MetaMask, at the level of the L2, and at the level of the L1. Right now, we only handle the basics, but frequently leave people guessing about what actually happened when a transaction didn't go though.
ToDo: come up with a good system for dealing with errors, and reporting those errors to the user (and, ultimately, an analytics backend so we can track errors). Step One is to report errors to the user, rather than writing to console.log. So every instance of
try {
await
return true
} catch (err) {
return false
}
needs to do something like this
try {
await
return true
} catch (error) {
REPORT_TO_USER (error.message)
REPORT_TO_ERROR_TRACKING_SERVICE (error.message)
return false
}
The old system (errorService.js
) used to do this, but it has not been updated/checked in a long time.
WebWalletError this class only extends the existing error object with two more properties called originalError and customErrorMessage class has function called report which just do nothing and return so looks like we have to add our sentry reporting here. As error.report() has been invoked in createAction catch method.
Please help me with sentry configuration I will get it added and raised the PR.