Skip to content

Commit

Permalink
Fix mypy web response
Browse files Browse the repository at this point in the history
  • Loading branch information
Dramelac committed Oct 21, 2023
1 parent cebc5f2 commit 969aad1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion exegol/utils/WebUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def __runRequest(cls, url: str, service_name: str, headers: Optional[Dict] = Non
response = requests.request(method=method, url=url, timeout=(5, 10), verify=ParametersManager().verify, headers=headers, data=data)
return response
except requests.exceptions.HTTPError as e:
logger.error(f"Response error: {e.response.content.decode('utf-8')}")
if e.response.content is not None:
logger.error(f"Response error: {e.response.content.decode('utf-8')}")
else:
logger.error(f"Response error: {e}")
except requests.exceptions.ConnectionError as err:
logger.debug(f"Error: {err}")
error_re = re.search(r"\[Errno [-\d]+]\s?([^']*)('\))+\)*", str(err))
Expand Down

0 comments on commit 969aad1

Please sign in to comment.