Skip to content

Commit

Permalink
Minor UX fix: sky cancel should not print stacktraces. (#1385)
Browse files Browse the repository at this point in the history
* Minor UX fix: `sky cancel` should not print stacktraces.

* Wording fix.

* exit 1
  • Loading branch information
concretevitamin authored Nov 9, 2022
1 parent b2d3555 commit 6a48a12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,9 @@ def cancel(cluster: str, all: bool, jobs: List[int]): # pylint: disable=redefin
core.cancel(cluster, all, jobs)
except ValueError as e:
raise click.UsageError(str(e))
except (exceptions.NotSupportedError, exceptions.ClusterNotUpError) as e:
click.echo(str(e))
sys.exit(1)


@cli.command(cls=_DocumentedCodeCommand)
Expand Down
2 changes: 1 addition & 1 deletion sky/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def _check_cluster_available(cluster_name: str,
with ux_utils.print_exception_no_traceback():
raise exceptions.ClusterNotUpError(
f'{colorama.Fore.YELLOW}Cluster {cluster_name!r} does not '
f'exist.{colorama.Style.RESET_ALL} skipped.')
f'exist; skipped.{colorama.Style.RESET_ALL}')
backend = backend_utils.get_backend_from_handle(handle)
if isinstance(backend, backends.LocalDockerBackend):
# LocalDockerBackend does not support job queues
Expand Down

0 comments on commit 6a48a12

Please sign in to comment.