You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all parts of the backend code which return responses provide the HTTP status code as an integer. For example, in Login.py:
return {"message": "Invalid email or password"}, 401
When designing responses or interpreting existing responses, this means I have to have a tab open to interpret different HTTP Status Codes.
A more readable option would be to replace the HTTP Status codes with enums, conveniently provided by native python library http as HTTPStatus. To give an example for the above code:
return {"message": "Invalid email or password"}, HTTPStatus.UNAUTHORIZED
The text was updated successfully, but these errors were encountered:
Currently, all parts of the backend code which return responses provide the HTTP status code as an integer. For example, in
Login.py
:When designing responses or interpreting existing responses, this means I have to have a tab open to interpret different HTTP Status Codes.
A more readable option would be to replace the HTTP Status codes with enums, conveniently provided by native python library
http
asHTTPStatus
. To give an example for the above code:The text was updated successfully, but these errors were encountered: