You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2019/06/06 16:21:14 UTC

[tinkerpop] branch master updated: Improved timeout messaging in console for :>

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/master by this push:
     new e19ba22  Improved timeout messaging in console for :>
     new 19a26d3  Merge branch 'tp34'
e19ba22 is described below

commit e19ba221f0e856e3611290a8ac900f602af0e67b
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Thu Jun 6 12:15:42 2019 -0400

    Improved timeout messaging in console for :>
    
    Just used the timeout message from the server as the output to the console rather than try to determine it in the console itself, since we don't really know the timeout configured on the server to do that in the case where the console doesn't set the timeout. CTR
---
 CHANGELOG.asciidoc                                                   | 1 +
 .../tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java       | 5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 9c5ea3d..cf8d532 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 This release also includes changes from <<release-3-3-8, 3.3.8>>.
 
+* Improved error messaging on timeouts returned to the console from `:>`.
 * Modified `NumberHelper` to better ignore `Double.NaN` in `min()` and `max()` comparisons.
 * Bump to Groovy 2.5.7.
 
diff --git a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
index b579b4b..fdbd937 100644
--- a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
+++ b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
@@ -173,10 +173,7 @@ public class DriverRemoteAcceptor implements RemoteAcceptor {
             if (inner.isPresent()) {
                 final ResponseException responseException = inner.get();
                 if (responseException.getResponseStatusCode() == ResponseStatusCode.SERVER_ERROR_TIMEOUT) {
-                    if (timeout > NO_TIMEOUT)
-                        throw new RemoteException(String.format("Request timed out at %s ms - increase the timeout with the :remote command", timeout));
-                    else
-                        throw new RemoteException(String.format("Request timed out at %s ms - increase the timeout with the :remote command", timeout));
+                    throw new RemoteException(String.format("%s - try increasing the timeout with the :remote command", responseException.getMessage()));
                 } else if (responseException.getResponseStatusCode() == ResponseStatusCode.SERVER_ERROR_SERIALIZATION)
                     throw new RemoteException(String.format(
                             "Server could not serialize the result requested. Server error - %s. Note that the class must be serializable by the client and server for proper operation.", responseException.getMessage()),