Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize errors making them to typed errors, get rid of "NamedError" #890

Open
izri16 opened this issue Mar 17, 2021 · 0 comments
Open
Assignees
Labels

Comments

@izri16
Copy link
Collaborator

izri16 commented Mar 17, 2021

Currently, errors are given "types" by setting their name with a string identifier, which is not centrally controlled and makes checking its specific type unwieldy. Possibly a good source of inspiration could be how errors are defined in ledgerjs library recently refactored by Ppershing: https://github.com/vacuumlabs/ledgerjs-cardano-shelley/blob/develop/src/errors/deviceStatusError.ts

https://docs.google.com/document/d/1w0nLLw1OuC9LpZLQ_p58W1dkdJglfbyH5GjGL_cuKMU/edit

TODO:

  • refactor unify the way we set errors to state
  • refactor setError, captureBySentry
  • refactor errorsWithHelps into enum
  • refactor getErrorMessage interface so it receives custom error classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants