Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2084

For remote requests in console display the remote stack trace

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.3.4
    • Fix Version/s: 3.4.0, 3.3.5
    • Component/s: console
    • Labels:
      None

      Description

      When sending remote scripts through the Gremlin Console that return an error, the console will display the message from the server, but if you view the stack trace it displays the local one which isn't helpful in understanding the cause of the failure. Here's an example:

      gremlin> g.V().outE().out()
      org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast to org.apache.tinkerpop.gremlin.structure.Vertex
      Type ':help' or ':h' for help.
      Display stack trace? [yN]y
      org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast to org.apache.tinkerpop.gremlin.structure.Vertex
      	at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:180)
      	at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
      	at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
      	at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
      	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
      	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
      	at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
      	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
      	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
      	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
      	at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:148)
      	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
      	at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:455)
      

      This forces the user to then dig around server logs to try to determine the more accurate cause of the error to their script. That's not always easy, especially if the console is connected to a Remote Gremlin Provider and server access is not possible. This change should only be for actual ResponseException that actually have a stacktrace included, otherwise it should just use the local one.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                spmallette Stephen Mallette
                Reporter:
                spmallette Stephen Mallette
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: