From 7bdaf68c961224d027ce298d8679314bf97d1025 Mon Sep 17 00:00:00 2001 From: SilverFire - Dima Naumenko Date: Tue, 25 Aug 2015 21:19:53 +0300 Subject: [PATCH] Modifications to implement ErrorResponseException --- src/controllers/TicketController.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/controllers/TicketController.php b/src/controllers/TicketController.php index e921cd5..13c2f57 100644 --- a/src/controllers/TicketController.php +++ b/src/controllers/TicketController.php @@ -15,11 +15,8 @@ use hipanel\modules\client\models\Client; use hipanel\modules\ticket\models\Thread; use hipanel\modules\ticket\models\TicketSettings; -use hipanel\modules\domain\models\Domain; -use hiqdev\hiart\HiResException; +use hiqdev\hiart\ErrorResponseException; use Yii; -use yii\data\Sort; -use yii\helpers\ArrayHelper; /** * Class TicketController. @@ -217,7 +214,7 @@ private function _ticketChange($options = [], $apiCall = 'Answer', $bulk = true) { try { Thread::perform($apiCall, $options, $bulk); - } catch (HiResException $e) { + } catch (ErrorResponseException $e) { return false; } @@ -225,8 +222,6 @@ private function _ticketChange($options = [], $apiCall = 'Answer', $bulk = true) } /** - * @throws HiResException - * * @return string */ public function actionGetQuotedAnswer() @@ -235,7 +230,9 @@ public function actionGetQuotedAnswer() if ($request->isAjax) { $id = $request->post('id'); if ($id !== null) { - $answer = Thread::perform('GetAnswer', ['id' => $id]); + try { + $answer = Thread::perform('GetAnswer', ['id' => $id]); + } catch (ErrorResponseException $e) {} if (isset($answer['message'])) { return '> ' . str_replace("\n", "\n> ", $answer['message']); }