Closed wildwilliam2 closed 1 year ago
Examples: If a user tries to send a transaction without a gas price set, the user will recieve an error notification that says: error - please set a gas price.
I think this branch should be an active branch that gets updated as more error handling is idenitified
Other errors to handle (that have not been handled yet): Incorrect addresses, other incorrect data inputs.
For these I would put try catches around statements like: connectWithSigner() and just claim that the nodeUrl is not good
IMPORTANT: We need to make sure that user errors are checked in the right order.
For example, it is important the before the confirmation message is sent, we check that the input is not empty for a transaction.
Another idea:
Stress test for errors like incorrect addresses, and use the error object to format the response.
Finally, try using snap_notify and update the message delivery from the backend.
forget about snap_notify.
Latest: I would like to lock the functions and essentially coerce the user into interacting with the notification. Put a try/catch and an await statement in displayNotification in index.ts, lock the other functions until the user dismisses the notification.
Most methods have little - meaningful - error handling. Would be good to change this, and return an error resposne to display on the front-end.