fastapi-jwt-auth
fastapi-jwt-auth copied to clipboard
Add message and status_code to base " AuthJWTException" class
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