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

Original error messages lost #486

Open
JustElectron opened this issue Jul 14, 2022 · 2 comments
Open

Original error messages lost #486

JustElectron opened this issue Jul 14, 2022 · 2 comments

Comments

@JustElectron
Copy link

All error handler callbacks should include the original error message in the parameters.
E.g, the _expired_token_callback takes e.jwt_header, e.jwt_data as parameters, thus the original error message is lost when setting the expired_token_loader.
Either the entire error should be set as parameter, I.e. _expired_token_callback(e: Exception) or alternatively you could add the error message as a string _expired_token_callback(e.jwt_header, e.jwt_data, str(e)).
The same applies for all error handlers which do not include the error message.

@vimalloc
Copy link
Owner

If you don't mind me asking, what is the use case you are trying to accomplish by having access to those strings? My first thought is that if those strings are passed into the callbacks, people might try to do some kind of conditional logic based on those strings, which means it would be hard for them to be changed in the future which I don't love.

@JustElectron
Copy link
Author

My first thought was to add the original error to the response message, but some of the errors may be too descriptive so I might not do that. Alternatively I would log the error message for troubleshooting. Without the original error you are kind of blind to what the issue is.

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

No branches or pull requests

2 participants