From a04059b6c19c3333c8c6b86d6b3fa26ed87b1117 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 24 Jan 2022 12:35:41 +0100 Subject: [PATCH] ProcessCommand: Require a node name explicitly --- application/clicommands/ProcessCommand.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/clicommands/ProcessCommand.php b/application/clicommands/ProcessCommand.php index 0d00a37..a6d1dac 100644 --- a/application/clicommands/ProcessCommand.php +++ b/application/clicommands/ProcessCommand.php @@ -101,6 +101,12 @@ class ProcessCommand extends Command */ public function checkAction() { + $nodeName = $this->params->shift(); + if (! $nodeName) { + Logger::error('A process name is required'); + exit(1); + } + try { $name = $this->params->get('config'); if ($name === null) { @@ -125,7 +131,7 @@ class ProcessCommand extends Command /** @var BpNode $node */ try { - $node = $bp->getNode($this->params->shift()); + $node = $bp->getNode($nodeName); MonitoringState::apply($bp); if ($bp->hasErrors()) { Logger::error("Checking Business Process '%s' failed: %s\n", $name, $bp->getErrors()); @@ -133,7 +139,7 @@ class ProcessCommand extends Command exit(3); } } catch (Exception $err) { - Logger::error("Checking Business Process '%s' failed: %s", $name, $err->getMessage()); + Logger::error("Checking Business Process '%s' failed: %s", $name, $err); exit(3); }