Skip to content

os2forms_forloeb: Send Maestro notification handler exception handling when sending digital post #190

@jekuaitk

Description

@jekuaitk

The Maestro notification handler gives succesful result even when an exception has occurred during Digital Post.

Processing is done via the Maestro helper

public function processJob(Job $job): JobResult {
    …
    $this->sendNotification($notificationType, $submission, $templateTask, $maestroQueueID);

    return JobResult::success();
  }

private function sendNotification(…) {
   …
   try {
        …
   }
   catch (\Exception $exception) {
      $this->error('Error sending notification: @message', $context + [
        '@message' => $exception->getMessage(),
        'handler_id' => 'os2forms_forloeb',
        'operation' => 'notification failed',
        'exception' => $exception,
      ]);
    }
}

Here an exception is caught and relevant logging is done. However, since the exception is not re-thrown, the job will end up being given the result success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions