From 868ee1c61cd70ab123b974bba70c2cc8614c96f3 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 29 Nov 2017 02:38:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B8=20=D0=BB=D0=BE=D0=B3=D0=B3=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=87=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B8=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- console/components/ErrorHandler.php | 20 ++++++++++++++++++++ console/config/config.php | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 console/components/ErrorHandler.php diff --git a/console/components/ErrorHandler.php b/console/components/ErrorHandler.php new file mode 100644 index 0000000..042dc2f --- /dev/null +++ b/console/components/ErrorHandler.php @@ -0,0 +1,20 @@ +error; + if ($exception instanceof Swift_TransportException) { + Yii::warning($exception); + return; + } + + Yii::error($exception); + } + +} diff --git a/console/config/config.php b/console/config/config.php index 7b5d94d..be4d94e 100644 --- a/console/config/config.php +++ b/console/config/config.php @@ -26,6 +26,9 @@ return [ 'urlManager' => [ 'hostInfo' => getenv('DOMAIN') ?: 'https://account.ely.by', ], + 'queue' => [ + 'on afterError' => [new console\components\ErrorHandler(), 'handleQueueError'], + ], ], 'controllerMap' => [ 'migrate' => [