Skip to content

Commit

Permalink
[Core] Raise error for none existing cluster when endpoint is called (#…
Browse files Browse the repository at this point in the history
…4117)

raise error for none existing cluster
  • Loading branch information
Michaelvll authored Oct 18, 2024
1 parent a34ccb7 commit 71a95f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sky/backends/backend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,10 @@ def get_endpoints(cluster: str,
cluster_records = get_clusters(include_controller=True,
refresh=False,
cluster_names=[cluster])
if not cluster_records:
with ux_utils.print_exception_no_traceback():
raise exceptions.ClusterNotUpError(
f'Cluster {cluster!r} not found.', cluster_status=None)
assert len(cluster_records) == 1, cluster_records
cluster_record = cluster_records[0]
if (not skip_status_check and
Expand Down

0 comments on commit 71a95f4

Please sign in to comment.