Skip to content

Commit 718f8fb

Browse files
committed
Merge remote-tracking branch 'origin/feature/190-maestro-notification-exception-handling' into release/selvbetjening-4.6.0
2 parents bbb8f8a + 7480dbc commit 718f8fb

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1515
- Added support for MeMo 1.2 and added additional validation of MeMo actions.
1616
- [PR-202](https://github.com/OS2Forms/os2forms/pull/202)
1717
- Removed non-digits from recipient id in Maestro digital post notifications.
18+
- [PR-191](https://github.com/OS2Forms/os2forms/pull/191)
19+
- Re-throws exception to ensure failed status during Maestro notification job.
1820

1921
## [4.1.0] 2025-06-03
2022

modules/os2forms_forloeb/src/MaestroHelper.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,14 @@ public function processJob(Job $job): JobResult {
205205

206206
$submission = $this->webformSubmissionStorage->load($submissionID);
207207

208-
$this->sendNotification($notificationType, $submission, $templateTask, $maestroQueueID);
208+
try {
209+
$this->sendNotification($notificationType, $submission, $templateTask, $maestroQueueID);
210+
}
211+
catch (\Exception $e) {
212+
// Logging is done by the sendNotification method.
213+
// The job should be considered failed.
214+
return JobResult::failure($e->getMessage());
215+
}
209216

210217
return JobResult::success();
211218
}
@@ -261,12 +268,15 @@ private function sendNotification(
261268
}
262269
}
263270
catch (\Exception $exception) {
271+
// Log with context and rethrow exception.
264272
$this->error('Error sending notification: @message', $context + [
265273
'@message' => $exception->getMessage(),
266274
'handler_id' => 'os2forms_forloeb',
267275
'operation' => 'notification failed',
268276
'exception' => $exception,
269277
]);
278+
279+
throw $exception;
270280
}
271281
}
272282

0 commit comments

Comments
 (0)