X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FErrorController.php;h=f2e1b69c51a22a6c580f476f203d3337f5bdc7dd;hb=1f6105289a49079809c2a4677b561bc82c62db88;hp=0207587bf89633f4ab6cf0461cf33091b91d6eff;hpb=f033354528986455d250e2ddbf43374aacede286;p=syj.git diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index 0207587..f2e1b69 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -1,5 +1,5 @@ _helper->SyjReset->resetPlaceHolders(); - $this->view->headLink()->appendStylesheet('css/generic.css'); - $this->view->headLink()->appendStylesheet('css/error.css'); + $this->view->headLink()->appendStylesheet('css/generic.css', 'all'); + $this->view->headLink()->appendStylesheet('css/error.css', 'all'); } public function errorAction() { @@ -41,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