]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/ErrorController.php
allow uploading a route as a file
[syj.git] / application / controllers / ErrorController.php
index fed3945cbd7dbf89322fb1604c1278f70d0f157f..486c24a948aef9138291d49a3ba910f2f5e2bc39 100644 (file)
@@ -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