From 0925f213bc3d6374c2a189be18d791f24a8d5865 Mon Sep 17 00:00:00 2001 From: Mikel Martin Date: Wed, 9 Oct 2024 00:09:52 +0200 Subject: [PATCH] Declare @throw Exception if we are catching it --- src/Infrastructure/TaskExecution/TaskRunnerStarter.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Infrastructure/TaskExecution/TaskRunnerStarter.php b/src/Infrastructure/TaskExecution/TaskRunnerStarter.php index 2752769..3cd8b8f 100644 --- a/src/Infrastructure/TaskExecution/TaskRunnerStarter.php +++ b/src/Infrastructure/TaskExecution/TaskRunnerStarter.php @@ -157,19 +157,20 @@ public function run(): void } catch (TaskRunnerRunException $ex) { Logger::logInfo($ex->getMessage()); Logger::logDebug($ex->getMessage(), 'Core', array(new LogContextData('ExceptionTrace', $ex->getTraceAsString()))); - // @phpstan-ignore-next-line } catch (Exception $ex) { Logger::logError( 'Failed to run task runner. Unexpected error occurred.', 'Core', - array('ExceptionMessage' => $ex->getMessage()) + array( + new LogContextData('ExceptionMessage', $ex->getMessage()) + ) ); Logger::logDebug( 'Failed to run task runner. Unexpected error occurred.', 'Core', array( - 'ExceptionMessage' => $ex->getMessage(), - 'ExceptionTrace' => $ex->getTraceAsString(), + new LogContextData('ExceptionMessage', $ex->getMessage()), + new LogContextData('ExceptionTrace', $ex->getTraceAsString()), ) ); } @@ -180,6 +181,7 @@ public function run(): void * * @throws TaskRunnerRunException * @throws TaskRunnerStatusStorageUnavailableException + * @throws Exception */ protected function doRun(): void {