MythicLegendary / SP10_FALL_2022

2 stars 0 forks source link

Implement error response in the backend/ Clean Up Notification Messages #43

Closed wildwilliam2 closed 1 year ago

wildwilliam2 commented 1 year ago

Most methods have little - meaningful - error handling. Would be good to change this, and return an error resposne to display on the front-end.

wildwilliam2 commented 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.

wildwilliam2 commented 1 year ago

I think this branch should be an active branch that gets updated as more error handling is idenitified

wildwilliam2 commented 1 year ago

Other errors to handle (that have not been handled yet): Incorrect addresses, other incorrect data inputs.

wildwilliam2 commented 1 year ago

For these I would put try catches around statements like: connectWithSigner() and just claim that the nodeUrl is not good

wildwilliam2 commented 1 year ago

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.

wildwilliam2 commented 1 year ago

Another idea:

Stress test for errors like incorrect addresses, and use the error object to format the response.

wildwilliam2 commented 1 year ago

Finally, try using snap_notify and update the message delivery from the backend.

wildwilliam2 commented 1 year ago

forget about snap_notify.

wildwilliam2 commented 1 year ago

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.