core
core copied to clipboard
feat: keyring controller error
Explanation
References
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 communicated my changes to consumers by updating changelogs for packages I've changed
- [ ] I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
[!NOTE] Introduces
KeyringControllerErrorwith codes/data/causes and refactors the controller and tests to use it, improving error wrapping and stability.
- Core (keyring-controller):
- New error class: Add
src/errors.tsdefiningKeyringControllerError(supportscode,data,causeand legacyoriginalError, JSON/string serialization).- Error refactor: Replace generic
Errorthrows withKeyringControllerErroracrosssrc/KeyringController.ts(e.g.,exportSeedPhrase,exportAccount, signing, user ops, vault ops, validation helpers).- Improved wrapping:
signTypedMessagenow wraps underlying errors withKeyringControllerError, preserving original cause.- Misc: Minor guard/typing tweaks (explicit HD type checks) and internal deadlock-safe state-change listener logic in tests.
- Tests:
- Update expectations to use
KeyringControllerErrorclass andKeyringControllerErrormessages from./constants.- Add comprehensive tests for error codes/data/causes and propagation from hardware keyrings.
- Config:
- Increase Jest coverage threshold for
branchesto95.5injest.config.js.Written by Cursor Bugbot for commit a1c8b4ffe417e6bde30cc89742d370f20bc01c7e. This will update automatically on new commits. Configure here.