Skip to content

Commit

Permalink
add info msg to cli output if logs are not available
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra Belousov authored and Alexandra Belousov committed Jan 16, 2025
1 parent 5ee7055 commit 34dd406
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runhouse/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,14 @@ def cluster_logs(
headers=rns_client.request_headers(),
)

if (
resp.status_code == 404
and resp.json().get("detail") == "No logs found for the requested resource"
):
console.print("Cluster logs are not available yet.")
return
if resp.status_code != 200:
console.print("Failed to load cluster logs.")
console.print(f"Failed to load cluster logs: {resp.json().get('detail')}.")
return

logs_file_url = resp.json().get("data").get("logs_presigned_url")
Expand Down

0 comments on commit 34dd406

Please sign in to comment.