ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-4988 More detailed error message.
Date Tue, 18 Apr 2017 10:45:18 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 65eeec5f4 -> ce8d0ba5d


IGNITE-4988 More detailed error message.


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

Branch: refs/heads/master
Commit: ce8d0ba5df050a4ca66f240b7192918998e9cef7
Parents: 65eeec5
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Tue Apr 18 17:46:20 2017 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Tue Apr 18 17:46:20 2017 +0700

----------------------------------------------------------------------
 .../processors/rest/GridRestProcessor.java       | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ce8d0ba5/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index c15aef7..f2f2b34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -63,6 +63,7 @@ import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.LT;
 import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.util.worker.GridWorker;
 import org.apache.ignite.internal.util.worker.GridWorkerFuture;
@@ -286,7 +287,21 @@ public class GridRestProcessor extends GridProcessorAdapter {
                     if (log.isDebugEnabled())
                         log.debug("Failed to handle request [req=" + req + ", e=" + e + "]");
 
-                    res = new GridRestResponse(STATUS_FAILED, e.getMessage());
+                    // Prepare error message:
+                    SB sb = new SB(256);
+
+                    sb.a("Failed to handle request: [req=").a(req.command());
+
+                    if (req instanceof GridRestTaskRequest) {
+                        GridRestTaskRequest tskReq = (GridRestTaskRequest)req;
+
+                        sb.a(", taskName=").a(tskReq.taskName())
+                            .a(", params=").a(tskReq.params());
+                    }
+
+                    sb.a(", err=").a(e.getMessage() != null ? e.getMessage() : e.getClass().getName()).a(']');
+
+                    res = new GridRestResponse(STATUS_FAILED, sb.toString());
                 }
 
                 assert res != null;
@@ -970,7 +985,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
         }
 
         /**
-         * Checks whether session at expired state (EPIRATION_FLAG) or not, if not then tries
to update last touch time.
+         * Checks whether session at expired state (EXPIRATION_FLAG) or not, if not then
tries to update last touch time.
          *
          * @return {@code False} if session timed out (not successfully touched).
          * @see #isTimedOut(long)


Mime
View raw message