Files
piratepoet/lib/Cron/Workers/SendingQueue/SendingErrorHandler.php
Rostislav Wolny 3ae8763837 Refactor sending error handling to extra class
The SendigQueue worker is already a very complex class and handles a lot of things.
Since we want to make error handling more sophisticated it is better to move the error handling responsibility
to a new class.

[MAILPOET-1154]
2018-09-13 11:12:38 +02:00

16 lines
498 B
PHP

<?php
namespace MailPoet\Cron\Workers\SendingQueue;
use MailPoet\Mailer\MailerError;
use MailPoet\Mailer\MailerLog;
class SendingErrorHandler {
function processError(MailerError $error) {
if($error->getRetryInterval() !== null) {
MailerLog::processNonBlockingError($error->getOperation(), $error->getMessageWithFailedSubscribers(), $error->getRetryInterval());
} else {
MailerLog::processError($error->getOperation(), $error->getMessageWithFailedSubscribers());
}
}
}