From 902bd7ee73793b1a79ee48396cc6c0bbe0fcc865 Mon Sep 17 00:00:00 2001 From: Jakub Dorfman Date: Sun, 26 Apr 2026 22:58:09 +0200 Subject: [PATCH] Improve error handling in deployment and stopping commands in panelctl.sh Co-authored-by: Copilot --- panel/panelctl.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panel/panelctl.sh b/panel/panelctl.sh index 14fe331..4619baf 100644 --- a/panel/panelctl.sh +++ b/panel/panelctl.sh @@ -276,7 +276,7 @@ cmd_render_route() { maybe_reload_caddy() { if [[ -x /run/current-system/sw/bin/caddy && -f /etc/caddy/Caddyfile ]]; then - /run/current-system/sw/bin/caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile + /run/current-system/sw/bin/caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile || echo "warning: caddy validation failed" >&2 fi if [[ "${EUID}" -eq 0 ]]; then @@ -300,7 +300,7 @@ cmd_deploy() { load_app "${name}" cmd_render_route "${name}" - run_compose -f "${APP_COMPOSE_FILE}" up -d + run_compose -f "${APP_COMPOSE_FILE}" up -d || fail "compose up failed" maybe_reload_caddy echo "deployed app '${name}'" @@ -311,7 +311,7 @@ cmd_stop() { validate_name "${name}" load_app "${name}" - run_compose -f "${APP_COMPOSE_FILE}" down + run_compose -f "${APP_COMPOSE_FILE}" down || fail "compose down failed" echo "stopped app '${name}'" } @@ -321,7 +321,7 @@ cmd_remove() { validate_name "${name}" load_app "${name}" - run_compose -f "${APP_COMPOSE_FILE}" down || true + run_compose -f "${APP_COMPOSE_FILE}" down 2>/dev/null || true # Remove this app's block from the aggregate routes file. if [[ -f "${APP_ROUTE_FILE}" ]]; then