-
Notifications
You must be signed in to change notification settings - Fork 36
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
Consolidate error handling #1304
Conversation
be82d1b
to
5bd6828
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how this is done, but there are still four occurrences of the old pattern in actions/account/index.ts
@chunningham ah missed that file, gonna convert it as well. For the |
theres multiple issues that can cause an identity wallet failure, mostly its internet connectivity issues but yeah something vague like "Unable to authenticate identity" or something should work. removing |
…/error_handling Conflicts: src/actions/account/index.ts updated the errors to match
484ba86
to
2eadf5e
Compare
Another point is about the error code strings, because we might want to actually display these to the users, and maybe they will be reported or something |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
There's an
AppError
class and associatedErrorCode
enum with constants for the kinds of application errors inlib/errors.ts
. Usage tends to benew AppError(ErrorCode.SomeError, caughtErr)
. EachAppError
has a related message, which it gets automatically based on type. It's a little annoying to import the class and enum and also refer to the error code like that, but it's the easiest way I could find so far. Any feedback on usage, error messages, and names of the class, enum, constants?I tested only 2 of the error conditions (
ParseJWTFailed
andCredentialRequestFailed
), probably needs more testing, perhaps as part of test cases for the sso actions.The
caughtError
gets logged, but I also think we should introduce sentry which is coincidentally free for opensource