tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [4/6] incubator-tinkerpop git commit: Prevented error on use of :x in gremlin console init script.
Date Wed, 27 Apr 2016 14:27:26 GMT
Prevented error on use of :x in gremlin console init script.

A simple fix - the init script execution just needed to occur inside an existing try/catch
block where normal script execution occurred. CTR


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/5f9d2f91
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/5f9d2f91
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/5f9d2f91

Branch: refs/heads/TINKERPOP-1232
Commit: 5f9d2f9140fe32ce090ba774a09c7fb49dc74ac5
Parents: f23def3
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Apr 27 07:56:16 2016 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Wed Apr 27 07:56:16 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                               | 1 +
 .../groovy/org/apache/tinkerpop/gremlin/console/Console.groovy   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f9d2f91/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index d6ef48b..422eb47 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
 TinkerPop 3.1.3 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Fixed bug where use of `:x` in a Gremlin Console initialization script would generate a
stack trace.
 * Added configuration options to Gremlin Driver and Server to override the SSL configuration
with an `SslContext`.
 * Added driver configuration settings for SSL: `keyCertChainFile`, `keyFile` and `keyPassword`.
 * Fixed bug where transaction managed sessions were not properly rolling back transactions
for exceptions encountered during script evaluation.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5f9d2f91/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
index 66b8b0e..a13e785 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
@@ -139,9 +139,11 @@ class Console {
 
         // start iterating results to show as output
         showShellEvaluationOutput(true)
-        if (initScriptFile != null) initializeShellWithScript(initScriptFile)
 
         try {
+            // if the init script contains :x command it will throw an ExitNotification so
init script execution
+            // needs to appear in the try/catch
+            if (initScriptFile != null) initializeShellWithScript(initScriptFile)
             runner.run()
         } catch (ExitNotification ignored) {
             // occurs on exit


Mime
View raw message