Enable better logging for queue

This commit is contained in:
ErickSkrauch 2023-10-15 04:09:09 +02:00
parent a1eb5f3be6
commit b98649070d
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
1 changed files with 3 additions and 10 deletions

View File

@ -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);
}
}