[ 
https://issues.apache.org/jira/browse/TINKERPOP-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16272345#comment-16272345
 ] 

ASF GitHub Bot commented on TINKERPOP-1811:
-------------------------------------------

Github user jorgebay commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/753#discussion_r154010923
  
    --- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
 ---
    @@ -173,6 +173,12 @@ private Object invokeMethod(final Object delegate, 
final Class returnType, final
             for (int i = 0; i < arguments.length; i++) {
                 argumentsCopy[i] = translateObject(arguments[i]);
             }
    +
    +        // without this initial check iterating an invalid methodName will 
lead to a null pointer and a less than
    +        // great error message for the user. 
    +        if (!methodCache.containsKey(methodName))
    +            throw new IllegalStateException("Could not locate method: " + 
delegate.getClass().getSimpleName() + "." + methodName + "(" + 
Arrays.toString(argumentsCopy) + ")");
    --- End diff --
    
    I agree, its more clear with empty parameters in the case of no method args.


> Improve error reporting for serialization errors between gremlin-python and 
> gremlin-server
> ------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1811
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1811
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: python, server
>    Affects Versions: 3.2.6
>            Reporter: Hugo Arts
>            Priority: Minor
>
> We ran into an issue while attempting to add a PartitionStrategy to our 
> traversals. This is a small example of a traversal I tried:
> {code:none}
> remote = DriverRemoteConnection('ws://localhost:8182/gremlin', 
> 'DSE_GRAPH_QUICKSTART.g')
> strategy = PartitionStrategy('community_id', '2097442560', 2097442560)
> g = Graph().traversal().withRemote(remote).withStrategies(strategy)
> print(g.V().toList())
> {code}
> The third argument of PartitionStrategy should be a list. However, the 
> traversal strategies in gremlin-python do not do any kind of argument/type 
> checking, and any mistake you make results in the following error from 
> gremlin server:
> {noformat}
> ERROR [gremlin-server-worker-1] 2017-10-25 10:15:53,285 GREMLIN 
> TraversalOpProcessor.java:365 - Could not deserialize the Traversal instance
> {noformat}
> I've omitted the [full 
> traceback|https://gist.github.com/anonymous/2ad6541d0169256afb1a23fbdc376009] 
> for brevity. There is not much indication as to what has gone wrong. 
> gremlin-python gives this error:
> {noformat}
> gremlin_python.driver.protocol.GremlinServerError: 599: None
> {noformat}
> Which is also unhelpful. We were eventually able to figure out what we were 
> doing wrong, but it would be very nice to have either some input validation 
> on the gremlin-python side, or have gremlin-server be more specific about the 
> nature of the deserialisation error (or both).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to