Skip to content

Conversation

@montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Dec 15, 2025

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 KeyringControllerError with 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.ts defining KeyringControllerError (supports code, data, cause and legacy originalError, JSON/string serialization).
    • Error refactor: Replace generic Error throws with KeyringControllerError across src/KeyringController.ts (e.g., exportSeedPhrase, exportAccount, signing, user ops, vault ops, validation helpers).
    • Improved wrapping: signTypedMessage now wraps underlying errors with KeyringControllerError, 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 KeyringControllerError class and KeyringControllerError messages from ./constants.
    • Add comprehensive tests for error codes/data/causes and propagation from hardware keyrings.
  • Config:
    • Increase Jest coverage threshold for branches to 95.5 in jest.config.js.

Written by Cursor Bugbot for commit a1c8b4f. This will update automatically on new commits. Configure here.

@montelaidev montelaidev requested review from a team as code owners December 15, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants