mirror of
https://github.com/elyby/accounts.git
synced 2024-11-26 16:52:02 +05:30
Enable better logging for queue
This commit is contained in:
parent
a1eb5f3be6
commit
b98649070d
@ -3,20 +3,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace console\components;
|
namespace console\components;
|
||||||
|
|
||||||
use Swift_TransportException;
|
|
||||||
use Yii;
|
use Yii;
|
||||||
use yii\queue\ExecEvent;
|
use yii\queue\ExecEvent;
|
||||||
|
|
||||||
class ErrorHandler {
|
final class ErrorHandler {
|
||||||
|
|
||||||
public function handleQueueError(ExecEvent $error): void {
|
public function handleQueueError(ExecEvent $event): void {
|
||||||
$exception = $error->error;
|
Yii::$app->errorHandler->handleException($event->error);
|
||||||
if ($exception instanceof Swift_TransportException) {
|
|
||||||
Yii::warning($exception);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Yii::error($exception);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user