Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 11 additions & 1 deletion modules/os2forms_forloeb/src/MaestroHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;
}
}

Expand Down