Skip to content

ref: full tracebacks on exceptions#870

Merged
vgrozdanic merged 1 commit intomasterfrom
vgrozdanic/full-tracebacks-on-exceptions
Mar 2, 2025
Merged

ref: full tracebacks on exceptions#870
vgrozdanic merged 1 commit intomasterfrom
vgrozdanic/full-tracebacks-on-exceptions

Conversation

@vgrozdanic
Copy link
Copy Markdown
Contributor

To get full tracebacks for easier debugging, when exception is caught and re-raised it needs to be re-raised as: raise Exception from e.

This PR adjust this behavior across the whole code base, and introduces consistency.

Fixes #832

Comment on lines -172 to -177
except InvalidAlgorithmError as ex:
raise TokenBackendError(_("Invalid algorithm specified")) from ex
except ExpiredSignatureError as ex:
raise TokenBackendExpiredToken(_("Token is expired")) from ex
except InvalidTokenError as ex:
raise TokenBackendError(_("Token is invalid")) from ex
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed for consistency across the whole codebase

Copy link
Copy Markdown
Member

@Andrew-Chen-Wang Andrew-Chen-Wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A silenced error for JWT Stateless Authentication during token validation

2 participants