From c135f366c365d493b7edc19c841e1817a3b18b49 Mon Sep 17 00:00:00 2001 From: drivenflywheel Date: Mon, 12 Aug 2024 16:41:59 +0000 Subject: [PATCH] Suppress server startup attempt when trying to pause a non-responsive server --- src/main/java/emissary/command/ServiceCommand.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/emissary/command/ServiceCommand.java b/src/main/java/emissary/command/ServiceCommand.java index 0da3624e86..8c5b776878 100644 --- a/src/main/java/emissary/command/ServiceCommand.java +++ b/src/main/java/emissary/command/ServiceCommand.java @@ -113,8 +113,13 @@ public void run(CommandLine c) { throw new EmissaryRuntimeException("Emissary " + getServiceName() + " is already running"); } } else { - // no running server so fire it up - startService(); + if (isPause()) { + // we hadn't intended to start the service, so don't try to do so now + throw new EmissaryRuntimeException("Error pausing service: request returned status " + response.getStatus()); + } else { + // no running server so fire it up + startService(); + } } } }