X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FErrorController.php;h=043b19945d898859a732fbc6e4bcc32c2114f141;hb=7ab93faefae14af39fc5449a2c3311dd68d2c0f9;hp=db283ab86d48844a3983f55316c0c0a0a0ccd695;hpb=190fd621df4920c56a422c03663874cddaa67d64;p=syj.git diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index db283ab..043b199 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -1,23 +1,16 @@ getResponse()->setHttpResponseCode($code); - $this->view->message = Zend_Http_Response::responseCodeAsText($code); } public function init() { - $this->view->jslocales = null; - $this->view->headScript()->exchangeArray(array()); - $this->view->headLink()->exchangeArray(array()); - $this->view->headTitle()->exchangeArray(array()); - $this->view->headStyle()->exchangeArray(array()); - - $this->view->headLink()->appendStylesheet('css/generic.css'); - $this->view->headLink()->appendStylesheet('css/error.css'); + $this->_helper->SyjReset->resetPlaceHolders(); + $this->_helper->SyjMedias->addStyleSheets('error'); } public function errorAction() { @@ -47,8 +40,13 @@ class ErrorController extends Zend_Controller_Action $log->crit($this->view->message, $error->exception); } - if ($error_code != 404 and $error_code != 410 and $error->request->isXmlHttpRequest()) { + if ($error_code == 400 and $error->request->isXmlHttpRequest()) { return $this->_helper->json(array('message' => $error->exception->getMessage())); + } else if ($error->exception instanceof Syj_Exception_InvalidGeomUpload) { + // invalid file upload: we will redirect to main page + $this->_helper->SyjReset->resetPlaceHolders(); + $this->_request->setControllerName('idx')->setActionName('error')->setDispatched(false); + return; } // conditionally display exceptions