You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "stephen mallette (JIRA)" <ji...@apache.org> on 2015/04/14 21:27:59 UTC

[jira] [Commented] (TINKERPOP3-633) exception on bad id

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

stephen mallette commented on TINKERPOP3-633:
---------------------------------------------

hmmm - the test isn't testing for an "invalid" id.  it's testing for an id that isn't present in the graph.  in other words, the {{MODERN}} graph shouldn't have an edge with an identifier of "100".  so you should be throwing the {{NoSuchElementException}} here.  Are you by-chance not implementing {{GraphProvider.convertId()}} ?  that method should take "100" and convert it to an identifier that your graph accepts.

of course, i'm now realizing that this approach isn't so perfect because it assumes that all graph elements return the same type for their id....going to remedy that now with a change to that method signature of

{code}
Object convertId(final Object id, final Class<? extends Element> c)
{code}


> exception on bad id
> -------------------
>
>                 Key: TINKERPOP3-633
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-633
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: structure
>            Reporter: pieter martin
>            Priority: Minor
>
> I am getting Sqlg up to date with the latest master branch.
> For {{EdgeTest.shouldThrowNoSuchElementExceptionIfEdgeWithIdNotPresent}} the test expects a {{NoSuchElementException}}
> Currently the test fails as I am throwing a custom InvalidId exception.
> When the graph has custom ids I reckon its better to tell the user that the id is altogether of the wrong format rather than just {{NoSuchElementException}}
> This is if the id is in fact not a valid id.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)