Include error JSON in CTMS errors
Closed this issue · 0 comments
jwhitlock commented
CTMS reports failed statuses with raise_for_status
, like:
basket/basket/news/backends/ctms.py
Lines 569 to 571 in ce94394
In Sentry, this reports:
- The status code (such as
422
) - The reason (such as
"Unprocessable Entity"
) - A summary message (such as
"422 Client Error: Unprocessable Entity for url: https://ctms.stage.mozilla-ess.mozit.cloud/ctms/{email_id}"
For a 422 and other errors, the JSON body of the response also has information, which is useful for diagnosing the error, and should be included in the context sent to Sentry