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

Add message and status_code to base " AuthJWTException" class #97

Open
martinEnerdis opened this issue Apr 20, 2023 · 0 comments
Open

Comments

@martinEnerdis
Copy link

Hello, for typing and linting purposes I think it would be a good idea to include those attributes (message and status code) to the base class, given that they are present in all sub classes. By doing so, the following code would get properly type checked:

@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException) -> JSONResponse:
    return JSONResponse(status_code=exc.status_code, content={"detail": exc.message})  # type: ignore
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

1 participant