public function processException(Exception $exception)
 {
     if ($exception instanceof Zend_Exception) {
         $this->_httpClient->getAdapter()->close();
     }
     parent::processException($exception);
 }
Exemple #2
0
 /**
  * Check if exist an alarm and try to recover it.
  *
  * @param $response
  */
 public function processResponseData(&$response)
 {
     //Check for ericsson recover exceptions
     $serviceName = $this->getRestService()->getServiceName();
     if (!$serviceName) {
         throw new \Application\Exceptions\UnexpectedException("Service Name doesn't exist");
     }
     App::alarm()->checkConnectionException($serviceName, null);
     //Check for ericsson result code
     if ($response && $response instanceof \Application\Proto\Response && $response->getResult() && ($code = $response->getResult()->getCode() && ($message = $response->getResult()->getReason()))) {
         App::alarm()->checkServiceInvalidResultCode($serviceName, $code, $message);
     }
     parent::processResponseData($response);
 }