From 70665b96c653eaea6ccef131e3590a363c7fd233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Sat, 13 Jan 2024 01:07:23 +0100 Subject: [PATCH] ProcessJobExecutor: improve subprocess fail message --- src/Executor/ProcessJobExecutor.php | 1 + tests/Unit/SimpleSchedulerTest.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Executor/ProcessJobExecutor.php b/src/Executor/ProcessJobExecutor.php index 595e530..2e9af63 100644 --- a/src/Executor/ProcessJobExecutor.php +++ b/src/Executor/ProcessJobExecutor.php @@ -200,6 +200,7 @@ private function createSubprocessFail(Process $execution, string $output, string $message = Message::create() ->withContext("Running job via command {$execution->getCommandLine()}") ->withProblem('Job subprocess failed.') + ->with('Tip', 'Make sure that job is executable by the command and that you have the error handler set.') ->with('stdout', trim($output)) ->with('stderr', $errorOutput); diff --git a/tests/Unit/SimpleSchedulerTest.php b/tests/Unit/SimpleSchedulerTest.php index 586992b..9e307f3 100644 --- a/tests/Unit/SimpleSchedulerTest.php +++ b/tests/Unit/SimpleSchedulerTest.php @@ -994,6 +994,8 @@ public function testProcessExecutorWithDefaultExecutable(): void <<<'MSG' Context: Running job via command %a Problem: Job subprocess failed. +Tip: Make sure that job is executable by the command and that you have the error + handler set. stdout: Could not open input file: bin/console stderr: MSG, @@ -1029,6 +1031,8 @@ public function testProcessStderr(): void <<<'MSG' Context: Running job via command %a Problem: Job subprocess failed. +Tip: Make sure that job is executable by the command and that you have the error + handler set. stdout:%c stderr: error MSG,