refactor(backend): type enumeration failures
prd-number-check / require-numbered-prds (pull_request) Successful in 6s
lint / lint (push) Successful in 1m0s
test / coverage (pull_request) Blocked by required conditions
test / unit (pull_request) Successful in 59s
test / image-input-builds (pull_request) Successful in 1m8s
test / integration-docker (pull_request) Waiting to run
tracker-policy-pr / check-pr (pull_request) Failing after 13s

This commit is contained in:
2026-07-26 22:32:43 +00:00
parent 90097a50ee
commit 38d3f0fe0c
8 changed files with 42 additions and 20 deletions
+6 -3
View File
@@ -16,6 +16,7 @@ from pathlib import Path
from typing import Any
from ...log import die, warn
from ..base import EnumerationError
# --- Lifecycle helpers (PRD 0018 chunk 3) ----------------------------------
@@ -75,12 +76,14 @@ def list_compose_projects(
)
except FileNotFoundError as exc:
if raise_on_error:
raise RuntimeError("docker compose ls failed: docker not found") from exc
raise EnumerationError(
"docker compose ls failed: docker not found"
) from exc
return []
if result.returncode != 0:
message = f"docker compose ls failed: {result.stderr.strip()}"
if raise_on_error:
raise RuntimeError(message)
raise EnumerationError(message)
if warn_on_error:
warn(message)
return []
@@ -89,7 +92,7 @@ def list_compose_projects(
except json.JSONDecodeError as e:
message = f"docker compose ls returned malformed JSON: {e}"
if raise_on_error:
raise RuntimeError(message) from e
raise EnumerationError(message) from e
if warn_on_error:
warn(message)
return []