X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FErrorController.php;h=f2e1b69c51a22a6c580f476f203d3337f5bdc7dd;hb=ccec698be8d221c48a6590af099d4390ee0a31e6;hp=db283ab86d48844a3983f55316c0c0a0a0ccd695;hpb=190fd621df4920c56a422c03663874cddaa67d64;p=syj.git diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index db283ab..f2e1b69 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -1,23 +1,17 @@ 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->view->headLink()->appendStylesheet('css/generic.css', 'all'); + $this->view->headLink()->appendStylesheet('css/error.css', 'all'); } public function errorAction() { @@ -47,8 +41,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