-
Notifications
You must be signed in to change notification settings - Fork 22
fix: status list error handling #334
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mirko Mollik <[email protected]>
Signed-off-by: Mirko Mollik <[email protected]>
Signed-off-by: Mirko Mollik <[email protected]>
By custom error instance, do you mean the StatusListException? If not, then the code is doing the opposite. |
Updated the description. I want to avoid the problem that you had: when the custom verify function is used, it needs to be wrapped to see if it was thrown during the status list verification. If you want your custom message, it has to be of type statuslist exception |
TimoGlastra
left a comment
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 think this is better. One improvement I'd suggest is to always keep the original error. A common pattern is to have a cause property on the error, so you can get a trace of wrapped errors. It can make debugging quite hard otherwise.
You can implement the tostring method to include also the stack of the cause, so you see where the original error was thrown, and not just where it was wrapped.
|
Erorr cause should be available in All modern browsers and Node.JS. I'm not sure about React Native. We use a polyfill for it, but that was from 4 years ago, and it might not be needed anymore now. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause |
Signed-off-by: Mirko Mollik <[email protected]>
Signed-off-by: Mirko Mollik <[email protected]>
Signed-off-by: Mirko Mollik <[email protected]>
Thanks for the useful resource, I update the extension classes to it. |
Signed-off-by: Mirko Mollik <[email protected]>
Improvement to #332
Signed-off-by: Mirko Mollik [email protected]