Skip to content

Commit

Permalink
Declare @throw Exception if we are catching it
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed Oct 8, 2024
1 parent bbc5b43 commit 44dd14e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Infrastructure/TaskExecution/TaskRunnerStarter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
)
);
}
Expand All @@ -180,6 +181,7 @@ public function run(): void
*
* @throws TaskRunnerRunException
* @throws TaskRunnerStatusStorageUnavailableException
* @throws Exception
*/
protected function doRun(): void
{
Expand Down

0 comments on commit 44dd14e

Please sign in to comment.