Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions oks_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def do_request(method, path, *args, **kwargs):
logging.debug(traceback.format_stack(limit = 4))
raise JSONClickException(err.response.text)

except (requests.exceptions.ConnectionError, requests.exceptions.Timeout) as err:
errors = {"Error": f"Failed to reach the endpoint {url} ({err.__class__.__name__})"}
raise JSONClickException(json.dumps(errors))

def build_headers():
"""Build HTTP headers for API requests based on environment authentication settings."""
headers = {
Expand Down