From a0ad4ffb202efe6e3365ba1392a32df3f988894f Mon Sep 17 00:00:00 2001 From: wxa Date: Wed, 3 Mar 2021 11:54:59 +0300 Subject: [PATCH] Log errors when saving sending task [MAILPOET-3379] --- lib/Tasks/Sending.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Tasks/Sending.php b/lib/Tasks/Sending.php index 344e8efb31..3508c0579f 100644 --- a/lib/Tasks/Sending.php +++ b/lib/Tasks/Sending.php @@ -164,6 +164,14 @@ class Sending { public function save() { $this->task->save(); $this->queue->save(); + $errors = $this->getErrors(); + if ($errors) { + $loggerFactory = LoggerFactory::getInstance(); + $loggerFactory->getLogger(LoggerFactory::TOPIC_NEWSLETTERS)->addError( + 'error saving sending task', + ['task_id' => $this->task->id, 'queue_id' => $this->queue->id, 'errors' => $errors] + ); + } return $this; }