core
core copied to clipboard
chore: add user-friendly error messages to user operation controller
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
UserOperationControllercommunicates with other entities throughout the lifecycle of each user operation. This includes:
- Submitting requests to the bundler.
- Sending requests to the
SmartContractAccountand therefore theKeyringControllerby 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