Log errors when saving sending task

[MAILPOET-3379]
This commit is contained in:
wxa
2021-03-03 11:54:59 +03:00
committed by Veljko V
parent 3f7b809bd4
commit a0ad4ffb20

View File

@@ -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;
}