From 336fe2eaf19c55790ef458d802e3c1f3430751b7 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Wed, 20 Aug 2025 12:38:35 +0200 Subject: [PATCH 1/2] #190: Rethrow exception to ensure failed job status in Maestro notification --- modules/os2forms_forloeb/src/MaestroHelper.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/os2forms_forloeb/src/MaestroHelper.php b/modules/os2forms_forloeb/src/MaestroHelper.php index d2dd0c5..eaa6a5b 100644 --- a/modules/os2forms_forloeb/src/MaestroHelper.php +++ b/modules/os2forms_forloeb/src/MaestroHelper.php @@ -205,7 +205,14 @@ public function processJob(Job $job): JobResult { $submission = $this->webformSubmissionStorage->load($submissionID); - $this->sendNotification($notificationType, $submission, $templateTask, $maestroQueueID); + try { + $this->sendNotification($notificationType, $submission, $templateTask, $maestroQueueID); + } + catch (\Exception $e) { + // Logging is done by the sendNotification method. + // The job should be considered failed. + return JobResult::failure($e->getMessage()); + } return JobResult::success(); } @@ -261,12 +268,15 @@ private function sendNotification( } } catch (\Exception $exception) { + // Log with context and rethrow exception. $this->error('Error sending notification: @message', $context + [ '@message' => $exception->getMessage(), 'handler_id' => 'os2forms_forloeb', 'operation' => 'notification failed', 'exception' => $exception, ]); + + throw $exception; } } From 7480dbc439a9bb982f1e294149f1e567a669e9a8 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Wed, 20 Aug 2025 12:43:22 +0200 Subject: [PATCH 2/2] #190: Updated CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbaf66e..3dbddf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +- [PR-191](https://github.com/OS2Forms/os2forms/pull/191) + Re-throws exception to ensure failed status during Maestro notification job. + ## [4.1.0] 2025-06-03 - [PR-176](https://github.com/OS2Forms/os2forms/pull/176)