diff flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java @ 5173:14d19313268a

Catch IllegalArgumentException instead of RuntimeException, added logging.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 05 Mar 2013 09:51:55 +0100
parents c1b60f8c3390
children 9d36ddf7dbd3
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Mon Mar 04 17:46:22 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java	Tue Mar 05 09:51:55 2013 +0100
@@ -102,12 +102,12 @@
 
 
     public static List<RiverAxis> getRiverAxis(String river)
-    throws RuntimeException {
+    throws IllegalArgumentException {
         return getRiverAxis(river, KIND_CURRENT);
     }
 
     public static List<RiverAxis> getRiverAxis(String river, int kind)
-    throws RuntimeException {
+    throws IllegalArgumentException {
         Session session = SessionHolder.HOLDER.get();
         Query query = session.createQuery(
             "from RiverAxis where river.name =:river AND kind.id =:kind");
@@ -119,10 +119,8 @@
             return list.isEmpty() ? null : list;
         }
         catch (RuntimeException re) {
-            throw iae;
+            throw re.getCause();
         }
-
-
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org