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.