X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FPathController.php;h=394da6921cac13042844cc78e0a5e4d99a839041;hb=6633e95b89c1d1eba9b7b0e612becaf11b085d69;hp=7d7ae6af8cd2bb843fa707195671bd627a876f3b;hpb=0722c496ca63f30937427e3bf8fbdd5cfee2c83d;p=syj.git diff --git a/application/controllers/PathController.php b/application/controllers/PathController.php index 7d7ae6a..394da69 100644 --- a/application/controllers/PathController.php +++ b/application/controllers/PathController.php @@ -78,7 +78,7 @@ class PathController extends Zend_Controller_Action } if ($geom::name != "LineString") { - throw new Syj_Exception_Request(); + throw new Syj_Exception_InvalidGeomUpload(); } $path->geom = $geom; @@ -90,20 +90,7 @@ class PathController extends Zend_Controller_Action /* now, saving !*/ $pathMapper = new Syj_Model_PathMapper(); - try { - $pathMapper->save ($path); - } catch(Zend_Db_Statement_Exception $e) { - if ($e->getCode() == 23505) { // 23505: Unique violation throw new Syj_Exception_Request(); - $message = $e->getMessage(); - if (strpos($message, 'paths_geom_key') !== false) { - throw new Syj_Exception_Request("uniquepath"); - } else { - throw $e; - } - } else { - throw $e; - } - } + $pathMapper->save ($path); } }