neo4j-contrib / gremlin-plugin

A Plugin for the Neo4j server add Tinkerpop-related functionality
Other
55 stars 23 forks source link

More info on errors? #8

Open virusman opened 11 years ago

virusman commented 11 years ago

We're getting random errors in neo4j gremlin plugin. Once in a few days it just returns BadInputException/NullPointerException until we restart neo4j. Error message and stack trace:

javax.script.ScriptException: java.lang.NullPointerException
["org.neo4j.server.plugin.gremlin.GremlinPlugin.executeScript(GremlinPlugin.java:84)",
"java.lang.reflect.Method.invoke(Method.java:601)",
"org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:57)",
"org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:168)",
"org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:300)",
"org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)",
"java.lang.reflect.Method.invoke(Method.java:601)"]

So it just rethrows any errors as BadInputException with no way to access the original stack trace. Is it possible to add output of the original stack trace somewhere?

virusman commented 11 years ago

It seems like the possible solution is to throw BadPluginInvocationException instead of BadInputException and provide the original exception to the constructor. Neo4j resolves such exceptions as output.badRequest( e.getCause() ), providing the original stack trace: https://github.com/neo4j/neo4j/blob/2.0/community/server/src/main/java/org/neo4j/server/rest/web/ExtensionService.java#L186