Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Handle not found for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineleclair committed Mar 16, 2024
1 parent 34387a7 commit b2141c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions discocli/commands/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def logs(disco: str | None, project: str | None, service: str | None) -> None:
stream=True,
verify=config.requests_verify(disco_config),
)
if response.status_code == 404:
click.echo("Not found")
return
for event in sseclient.SSEClient(response).events():
log_item = json.loads(event.data)
if "com.docker.swarm.service.name" not in log_item["labels"]:
Expand Down

0 comments on commit b2141c9

Please sign in to comment.