From b2141c916a51af08b20f0a98358bf8e2835f2f9e Mon Sep 17 00:00:00 2001 From: Antoine Leclair Date: Sat, 16 Mar 2024 16:47:29 -0400 Subject: [PATCH] Handle not found for logs --- discocli/commands/logs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discocli/commands/logs.py b/discocli/commands/logs.py index 1d33146..8d2372f 100644 --- a/discocli/commands/logs.py +++ b/discocli/commands/logs.py @@ -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"]: