mirror of
https://github.com/elyby/accounts.git
synced 2024-11-08 13:42:30 +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;
|
||||
|
||||
use Swift_TransportException;
|
||||
use Yii;
|
||||
use yii\queue\ExecEvent;
|
||||
|
||||
class ErrorHandler {
|
||||
final class ErrorHandler {
|
||||
|
||||
public function handleQueueError(ExecEvent $error): void {
|
||||
$exception = $error->error;
|
||||
if ($exception instanceof Swift_TransportException) {
|
||||
Yii::warning($exception);
|
||||
return;
|
||||
}
|
||||
|
||||
Yii::error($exception);
|
||||
public function handleQueueError(ExecEvent $event): void {
|
||||
Yii::$app->errorHandler->handleException($event->error);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user