ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [08/35] ignite git commit: IGNITE-2397 Returned more informative message.
Date Thu, 28 Apr 2016 13:01:52 GMT
IGNITE-2397 Returned more informative message.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/03f8bf4c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/03f8bf4c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/03f8bf4c

Branch: refs/heads/ignite-db-x-10884
Commit: 03f8bf4c87ef22fe1871c488f0c8a88d3d91f8c5
Parents: 97cf2b3
Author: Andrey Novikov <anovikov@gridgain.com>
Authored: Tue Apr 26 09:26:08 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Tue Apr 26 09:26:08 2016 +0700

----------------------------------------------------------------------
 .../processors/rest/handlers/query/QueryCommandHandler.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/03f8bf4c/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
index 0c44077..67e146b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.rest.handlers.query;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -45,6 +46,7 @@ import org.apache.ignite.internal.processors.rest.handlers.GridRestCommandHandle
 import org.apache.ignite.internal.processors.rest.request.GridRestRequest;
 import org.apache.ignite.internal.processors.rest.request.RestQueryRequest;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
+import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiPredicate;
 
@@ -263,6 +265,7 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter
{
         }
 
         /** {@inheritDoc} */
+        @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
         @Override public GridRestResponse call() throws Exception {
             final long qryId = qryIdGen.getAndIncrement();
 
@@ -346,7 +349,10 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter
{
             catch (Exception e) {
                 removeQueryCursor(qryId, qryCurs);
 
-                return new GridRestResponse(GridRestResponse.STATUS_FAILED, e.getMessage());
+                SQLException sqlErr = X.cause(e, SQLException.class);
+
+                return new GridRestResponse(GridRestResponse.STATUS_FAILED,
+                    sqlErr != null ? sqlErr.getMessage() : e.getMessage());
             }
         }
 


Mime
View raw message