-
-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log HTTPError
response text
#1008
Log HTTPError
response text
#1008
Conversation
social_core/utils.py
Outdated
@@ -225,6 +225,8 @@ def wrapper(*args, **kwargs): | |||
try: | |||
return func(*args, **kwargs) | |||
except requests.HTTPError as err: | |||
social_logger.error(err.response.text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging just the text response might be confusing, it can also be empty.
social_logger.error(err.response.text) | |
social_logger.error("request failes with %d: %s", err.response.status_code, err.response.text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, better. Thanks.
acad3c4
to
26bec93
Compare
Seems to be a clash of lint constraints. |
fa8bb3c
to
c0a5074
Compare
You're quite right. It looked wrong and I "corrected" it to interpolate a tuple of values like you would for Reverted to c0a5074 Thanks for feedback! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1008 +/- ##
==========================================
+ Coverage 77.88% 77.95% +0.06%
==========================================
Files 347 347
Lines 10669 10694 +25
Branches 504 455 -49
==========================================
+ Hits 8310 8336 +26
+ Misses 2200 2198 -2
- Partials 159 160 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Proposed changes
Logging the response text for an
HTTPError
greatly improves the developer's ability to figure out what might going wrong with an integration.Checklist