mirror of
https://github.com/elyby/accounts.git
synced 2024-12-28 16:10:40 +05:30
21 lines
397 B
PHP
21 lines
397 B
PHP
|
<?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);
|
||
|
}
|
||
|
|
||
|
}
|