Skip to content

Commit

Permalink
[ci] merge this down
Browse files Browse the repository at this point in the history
  • Loading branch information
driazati committed Jun 28, 2022
1 parent 52689bd commit 75b9df7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/scripts/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,17 @@ def _request(self, full_url: str, body: Dict[str, Any], method: str) -> Dict[str

try:
with request.urlopen(req, data) as response:
response = json.loads(response.read())
content = response.read()
except error.HTTPError as e:
logging.info(f"Error response: {e.read().decode()}")
e.seek(0)
raise e

logging.info(f"Got response from {full_url}: {content}")
try:
response = json.loads(content)
except json.decoder.JSONDecodeError as e:
return content

return response

Expand Down

0 comments on commit 75b9df7

Please sign in to comment.