I'm trying to use the gremlin npm module and connect to a Neptune database. During testing, I tried having gremlin connect to an inactive endpoint and invalid url to make the system more resilient. I expected some sort of error to be thrown. However, with invalid/inactive urls, graph traversals just don't resolve with no messaging.
const traversal = gremlin.process.AnonymousTraversalSource.traversal;
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
const dc = new DriverRemoteConnection('wss://localhost:80');
const g = traversal().withRemote(dc);
const data = await g.V().limit(1).toList();
console.log(data);
I'd expect g.V().limit(1).toList()
to throw an error when using an invalid remote connection. Again, the promise never resolves and the console.log(data)
on the next line is never run.
Any help with this would be much appreciated! I need some sort of system to detect whether the database connection is valid and if not logs errors.
There is an issue in the current JavaScript GLV, we've filed TINKERPOP-2381 that summarizes the problems.
This should not affect the GLV when the address points to a valid server.
Thanks for providing so much detail in the question.
I'm adding an answer so that this thread is preserved.
After investigation if the host does not exist the 3.4.1 JavaScript Gremlin client throws an exception and exits the process. With the 3.4.4 client (or later) the error seems to get silently swallowed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With