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
9 changes: 5 additions & 4 deletions lib/stardag/src/stardag/_cli/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def _handle_api_error(response: httpx.Response, resource: str = "resource") -> N
err=True,
)
elif response.status_code == 403:
typer.echo(
f"Error: Permission denied. Admin role or higher is required to modify {resource}.",
err=True,
)
try:
detail = response.json().get("detail", "Permission denied")
except ValueError:
detail = "Permission denied"
typer.echo(f"Error: {detail}", err=True)
elif response.status_code == 404:
typer.echo(f"Error: {resource.capitalize()} not found.", err=True)
elif response.status_code == 409:
Expand Down
Loading