db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r614028 - /db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java
Date Mon, 21 Jan 2008 22:02:02 GMT
Author: clr
Date: Mon Jan 21 14:02:01 2008
New Revision: 614028

URL: http://svn.apache.org/viewvc?rev=614028&view=rev
Log:
JDO-570 Improve error handling; add query string to unexpected exception

Modified:
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java?rev=614028&r1=614027&r2=614028&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/QueryTest.java Mon Jan 21 14:02:01
2008
@@ -28,6 +28,7 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.jdo.JDOException;
 import javax.jdo.JDOUserException;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
@@ -1303,8 +1304,14 @@
             }
         } catch (JDOUserException e) {
             if (positive) {
-                throw e;
-            }
+                String msg = "JDOUserException thrown while executing query:\n" +
+                        singleStringQuery;
+                throw new JDOException(msg, e);
+            }
+        } catch (JDOException e) {
+            String msg = "JDOException thrown while executing query:\n" +
+                    singleStringQuery;
+            throw new JDOException(msg, e);
         } finally {
             if (tx.isActive()) {
                 tx.rollback();
@@ -1454,8 +1461,14 @@
             tx.commit();
         } catch (JDOUserException e) {
             if (positive) {
-                throw e;
-            }
+                String msg = "JDOUserException thrown while executing query:\n" +
+                        singleStringQuery;
+                throw new JDOException(msg, e);
+            }
+        } catch (JDOException e) {
+            String msg = "JDOException thrown while executing query:\n" +
+                    singleStringQuery;
+            throw new JDOException(msg, e);
         } finally {
             if (tx.isActive()) {
                 tx.rollback();



Mime
View raw message