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']); }