Skip to content

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

@martinEnerdis

Description

@martinEnerdis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions