accounts/console/components/ErrorHandler.php

21 lines
397 B
PHP
Raw Normal View History

<?php
namespace console\components;
use Swift_TransportException;
use Yii;
use yii\queue\ErrorEvent;
class ErrorHandler {
public function handleQueueError(ErrorEvent $error): void {
$exception = $error->error;
if ($exception instanceof Swift_TransportException) {
Yii::warning($exception);
return;
}
Yii::error($exception);
}
}