Closed himalacharya closed 3 years ago
you can try to use e.message and e.status_code if you only print e it gives nothing
you can try to use e.message and e.status_code if you only print e it gives nothing
When I supply wrong access token , it gives status code 422. It needs to give 401.
The reason I use status code 422 because sending invalid fields will result in a 422 Unprocessable Entity response. Can you give reasonable use 401 instead of 422 when the token is invalid?
Yeah I got it.
While testing protected endpoint, I put wrong access token (deleting some values in actual access token) in Postman. I tired to print AuthJwt exception but it gives nothing. When I donot supply access token, no any exception message is printed. For example: access token is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
But I put access token in Postman as eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJz to test It gives nothing while printing print(e).
Code in main.py
How toc check individual exception?