if ($error->exception instanceof Syj_Exception_ToolargeGeomUpload) {
$maxsize = $this->_bytesToString(min($this->_strToBytes(ini_get('upload_max_filesize')),
$this->_strToBytes(ini_get('upload_max_filesize'))));
- $this->view->errorMsg = $this->view->translate('File too large. File size must not exceed %s', $maxsize);
+ $errorMsg = __('File too large. File size must not exceed %s', $maxsize);
} else if ($error->exception instanceof Syj_Exception_InvalidGeomUpload) {
- $this->view->errorMsg = $this->view->translate("Invalid file");
+ if ($error->exception->getMessage() === 'uniquepath') {
+ $errorMsg = __("similar path seems to already exist. Please do not create two exactly identical paths");
+ } else {
+ $errorMsg = __("Invalid file");
+ }
}
+ $this->view->errorMsg = $errorMsg;
}
}
}
if ($geom::name != "LineString") {
- throw new Syj_Exception_Request();
+ throw new Syj_Exception_InvalidGeomUpload();
}
$path->geom = $geom;
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");
+ throw new Syj_Exception_InvalidGeomUpload("uniquepath");
} else {
throw $e;
}