Skip to content

Commit

Permalink
add log error on http request
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvaingaudan committed Oct 8, 2024
1 parent 044f4ef commit deaf9ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arlas/cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ def __arlas__(arlas: str, suffix, post=None, put=None, patch=None, delete=None,
else:
print("Error: request {} failed with status {}: {}".format(method, str(r.status_code), str(r.reason)), file=sys.stderr)
print(" url: {}".format(url), file=sys.stderr)
print(r.content)
exit(1)
except Exception as e:
print("Error: request {} failed on {}".format(method, e), file=sys.stderr)
Expand Down Expand Up @@ -466,6 +467,7 @@ def __es__(arlas: str, suffix, post=None, put=None, delete=None, exit_on_failure
elif exit_on_failure:
print("Error: request {} failed with status {}: {}".format(method, str(r.status_code), str(r.reason)), file=sys.stderr)
print(" url: {}".format(url), file=sys.stderr)
print(r.content)
exit(1)
else:
raise RequestException(r.status_code, r.content)
Expand Down

0 comments on commit deaf9ad

Please sign in to comment.