Skip to content

Commit

Permalink
feat: Log HTTPError response text (#1008)
Browse files Browse the repository at this point in the history
* Log HTTP error response
* Add more detail to logged response

Co-authored-by: Dennis McGregor <cluttering@gmail.com>
  • Loading branch information
dases and Dennis McGregor authored Jan 27, 2025
1 parent 8fdc85b commit 67abf8f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions social_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except requests.HTTPError as err:
social_logger.exception(
"Request failed with %d: %s",
err.response.status_code,
err.response.text,
)

if err.response.status_code == 400:
raise AuthCanceled(args[0], response=err.response)
if err.response.status_code == 401:
Expand Down

0 comments on commit 67abf8f

Please sign in to comment.