[
https://issues.apache.org/jira/browse/TINKERPOP-2290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16940891#comment-16940891
]
ASF GitHub Bot commented on TINKERPOP-2290:
-------------------------------------------
gion commented on pull request #1202: TINKERPOP-2290 Add a way to catch a
connection error
URL: https://github.com/apache/tinkerpop/pull/1202
and prevent the program from exiting whenever the db disconnects
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Javascript GLV connection refused error handling
> ------------------------------------------------
>
> Key: TINKERPOP-2290
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2290
> Project: TinkerPop
> Issue Type: Bug
> Components: javascript
> Affects Versions: 3.4.1
> Reporter: Ted Wilmes
> Priority: Major
> Attachments: testing.js
>
>
> I believe the Javascript driver is emitting connection refused errors in a
> manner that makes it difficult for users to add in retry and other error
> handling logic. My Javascript knowledge is minimal so apologies if the below
> examples are non-idiomatic Javascript.
> Here's an example of the error:
> {code:java}
> UNCAUGHT: { Error: connect ECONNREFUSED 127.0.0.1:8182
> at Object._errnoException (util.js:1022:11)
> at _exceptionWithHostPort (util.js:1044:20)
> at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
> code: 'ECONNREFUSED',
> errno: 'ECONNREFUSED',
> syscall: 'connect',
> address: '127.0.0.1',
> port: 8182 }
> UNCAUGHT: TypeError: Cannot read property 'aborted' of null
> at ClientRequest._req.on
> (/home/twilmes/repos/nodetest/node_modules/ws/lib/WebSocket.js:644:19)
> at emitOne (events.js:116:13)
> at ClientRequest.emit (events.js:211:7)
> at Socket.socketCloseListener (_http_client.js:363:9)
> at emitOne (events.js:121:20)
> at Socket.emit (events.js:211:7)
> at TCP._handle.close [as _onclose] (net.js:567:12) {code}
> I did some looking at that UNCAUGHT TypeError is a separate issue and appears
> to be fixed in a newer version of the WS package that is being used.
> To reproduce this problem, you can either start an application up and point
> it at a non-existant TP enabled DB (JanusGraph in my case) or turn the graph
> off while the application is running. After this is done, an error is logged
> but the only way I'm able to catch it is to do something like this:
> {code:java}
> process.on('uncaughtException', function (err) {
> console.log("UNCAUGHT: ", err);
> });{code}
> Wrapping my queries and connection code in try/catch blocks does not catch
> anything.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)