fix: use response.text to get string rather than bytes

Signed-off-by: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com>
This commit is contained in:
Mehmet Nuri Deveci 2023-07-06 18:22:37 -07:00
parent 84414e343e
commit a6c3d24393
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ def create_api_error_from_http_exception(e):
try:
explanation = response.json()['message']
except ValueError:
explanation = (response.content or '').strip()
explanation = (response.text or '').strip()
cls = APIError
if response.status_code == 404:
explanation_msg = (explanation or '').lower()