mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 12:28:07 +00:00
Resolving Variable Reference Error (#2903)
This commit is contained in:
committed by
GitHub
parent
f12319b359
commit
e653f9b73e
@ -415,9 +415,6 @@ class Backend:
|
|||||||
if response.status_code // 100 != 2:
|
if response.status_code // 100 != 2:
|
||||||
try:
|
try:
|
||||||
json = response.json()
|
json = response.json()
|
||||||
except requests.exceptions.JSONDecodeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# attempt to read as https://www.rfc-editor.org/rfc/rfc7807
|
# attempt to read as https://www.rfc-editor.org/rfc/rfc7807
|
||||||
if isinstance(json, Dict):
|
if isinstance(json, Dict):
|
||||||
title = json.get("title")
|
title = json.get("title")
|
||||||
@ -425,6 +422,8 @@ class Backend:
|
|||||||
raise Exception(
|
raise Exception(
|
||||||
f"request did not succeed ({response.status_code}: {title}): {details}"
|
f"request did not succeed ({response.status_code}: {title}): {details}"
|
||||||
)
|
)
|
||||||
|
except requests.exceptions.JSONDecodeError:
|
||||||
|
pass
|
||||||
|
|
||||||
error_text = str(
|
error_text = str(
|
||||||
response.content, encoding="utf-8", errors="backslashreplace"
|
response.content, encoding="utf-8", errors="backslashreplace"
|
||||||
|
Reference in New Issue
Block a user