public function errorAction()
 {
     parent::errorAction();
     $error = $this->_errSrv->createError($this->_exception);
     if ($error->getHttpCode()) {
         $this->_httpCode = $error->getHttpCode();
         $this->getResponse()->setHttpResponseCode($this->_httpCode);
     }
     if (!empty($this->_errorMessages)) {
         $errMess = array();
         foreach ($this->_errorMessages as $key => $err) {
             if ($err instanceof ModelAbstract) {
                 $err = $err->exportData();
             }
             $errMess[$key] = $err;
         }
         $error->description .= "\n[JSON]\n" . Zend_Json::encode($errMess) . "\n[\\JSON]\n";
     }
     if (!empty($this->_validationErrors)) {
         $errors = array();
         $error->description .= "\n[JSON]\n" . Zend_Json::encode($this->_validationErrors) . "\n[\\JSON]\n";
     }
     $data = $this->_mapError($error);
     if ($error->fault->code === \Externalr12\Model\Error\FaultModel::FAULT_CODE_CLIENT) {
         $this->view->ClientException = $data;
     } else {
         $this->view->ServerException = $data;
     }
 }
 public function init()
 {
     $this->_errSrv = ErrorService::getInstance();
 }