Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 16 additions & 11 deletions src/vws_cli/vumark.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,23 @@ def _handle_vumark_exceptions() -> Iterator[None]:
try:
yield
except (UnknownTargetError, TargetStatusNotSuccessError) as exc:
if isinstance(exc, UnknownTargetError):
error_message = f'Error: Target "{exc.target_id}" does not exist.'
else:
error_message = (
f'Error: The target "{exc.target_id}" is not in the success '
"state and cannot be used to generate a VuMark instance."
)
match exc:
case UnknownTargetError():
error_message = (
f'Error: Target "{exc.target_id}" does not exist.'
)
case _:
error_message = (
f'Error: The target "{exc.target_id}" is not in the '
"success state and cannot be used to generate a "
"VuMark instance."
)
except (VWSError, ServerError) as exc:
if isinstance(exc, InvalidInstanceIdError):
error_message = "Error: The given instance ID is invalid."
else:
error_message = get_error_message(exc=exc)
match exc:
case InvalidInstanceIdError():
error_message = "Error: The given instance ID is invalid."
case _:
error_message = get_error_message(exc=exc)
else:
return

Expand Down
62 changes: 31 additions & 31 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading