Re: [Neo4j] GET nonexistent node with REST API (java): exception

30 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Michael Hunger

ungelesen,
11.05.2013, 18:41:1811.05.13
an ne...@googlegroups.com
Your URL was wrong, it was missing /node

you got the 404 for the missing endpoint that you looked for.


HTTP/1.1 404 Not Found
Content-Length: 490
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Server: Jetty(6.1.25)

{
  "message" : "Cannot find node with id [123123] in database.",
  "exception" : "NodeNotFoundException",
  "fullname" : "org.neo4j.server.rest.web.NodeNotFoundException",
  "stacktrace" : [ "org.neo4j.server.rest.web.DatabaseActions.node(DatabaseActions.java:188)", "org.neo4j.server.rest.web.DatabaseActions.getNode(DatabaseActions.java:249)", "org.neo4j.server.rest.web.RestfulGraphDatabase.getNode(RestfulGraphDatabase.java:262)", "java.lang.reflect.Method.invoke(Method.java:597)" ]
}yrintri:neo4j-axel mh$ 


Am 12.05.2013 um 00:33 schrieb Paul:

GET nonexistent node with REST API (java) throws an UniformInterfaceException (costly) - seems to be just 404 response (as expected) but wrapped in Exception:

Exception in thread "main" com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:7474/db/data/123123 returned a response status of 404 Not Found
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:686)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)

Surely there's a more efficient way to check a node's existence, and I just haven't found it. I'd use "create unique" but don't see that supported for "get by ID" - and I have to operate on a node ID in this case. 

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten