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]
16 lines
498 B
PHP
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());
|
|
}
|
|
}
|
|
}
|