core icon indicating copy to clipboard operation
core copied to clipboard

chore: add user-friendly error messages to user operation controller

Open dbrans opened this issue 1 year ago • 0 comments

Explanation

Introduce custom error messages and prefixes to add additional clarity to the user in the event of an error.

Background

@matthewwalsh0 wrote in internal ticket:

The UserOperationController communicates with other entities throughout the lifecycle of each user operation. This includes:

  • Submitting requests to the bundler.
  • Sending requests to the SmartContractAccount and therefore the KeyringController by default.
  • Sending requests to the RPC provider.

In all these instances, there is currently no custom error capturing logic meaning the errors from these entities present directly to the user in the case of an error. This can lead to ambiguous or technical error messages that are undesirable to surface in the clients.

References

  • Fixes https://github.com/MetaMask/MetaMask-planning/issues/2003

Changelog

@metamask/user-operation-controller

  • CHANGED: Added user-friendly error messages

Checklist

  • [ ] I've updated the test suite for new or updated code as appropriate
  • [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate

dbrans avatar Feb 21 '24 21:02 dbrans