More helpful errors in logs / terminal #7808
Unanswered
tim-mccurrach
asked this question in
Ideas & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checklist
master
branch of Django REST framework.failingpassing test as a pull request.Steps to reproduce
Useful information from Exceptions that could helpfully be logged is often not:
ExpectedHoped for behaviorActual behavior
The terminal is probably the first place I look when something isn't working, and the above doesn't leave much of a starting point for investigation. In my case it turned out to just be a
ValidationError
, but I didn't think of checking the response body (where the error details were returned) until quite a bit of time spent debugging (and not getting anywhere). It would be useful to have slightly more info than just the status code (especially for people new to DRF!).The logging above actually happens in django, not DRF, however django provides means to customise the message. (see PR)
This will:
ValidationError
s andParserError
s, (which are both 400s) and betweenAuthenticationFailed
andNotAuthenticated
errors (which are both 401s).Beta Was this translation helpful? Give feedback.
All reactions