You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/01/13 20:25:00 UTC

[jira] [Commented] (TINKERPOP-2853) Gremlin.Net driver should throw better exception message for unsupported GraphBinary type

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

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

tormodhau opened a new pull request, #1941:
URL: https://github.com/apache/tinkerpop/pull/1941

   Fixes: https://issues.apache.org/jira/browse/TINKERPOP-2853
   
   When reading a non-registered custom type with GraphBinary, a generic exception is thrown:
   
       System.Collections.Generic.KeyNotFoundException: The given key 'janusgraph.RelationIdentifier' was not 
       present in the dictionary. 
   
   Now the following exception gets thrown instead:
   
       System.InvalidOperationException: No serializer found for type 'janusgraph.RelationIdentifier'
   
   This is the same exception and message that gets throw when _writing_ a non-registered custom type. 
   
   The change has been verified by writing two new tests:
   
   - One to document the added _read_ behaviour
   - One to document the existing _write_ behaviour (which was undocumented)
   
   And running the `Gremlin.Net` test suite




> Gremlin.Net driver should throw better exception message for unsupported GraphBinary type
> -----------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2853
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2853
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet
>    Affects Versions: 3.6.1, 3.5.4
>            Reporter: Florian Hockmann
>            Priority: Minor
>
> The driver currently throws an exception that isn't very telling:
> {code:java}
> System.Collections.Generic.KeyNotFoundException : The given key 'janusgraph.RelationIdentifier' was not present in the dictionary. {code}
> It would be good if it would instead clearly state that no serializer was found for the GraphBinary type. This was first reported [on the janusgraph-users list|https://lists.lfaidata.foundation/g/janusgraph-users/message/6673].
> The exception gets thrown [here|https://github.com/apache/tinkerpop/blob/60b2792d63604b3baec68201adf35ed7f1d1e558/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphBinary/TypeSerializerRegistry.cs#L282] for types received from the server where no serializer is registered for the driver.
> For the write path however, the exception thrown [is already more telling|https://github.com/apache/tinkerpop/blob/60b2792d63604b3baec68201adf35ed7f1d1e558/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphBinary/TypeSerializerRegistry.cs#L224].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)