Closed japita-se closed 5 years ago
What do you mean? Can you show a trace? Note that the error is fatal, so you can't just catch it and move on.
You can listen to the error event on the socket and act on it.
If the server the socket is trying to connect to is not responding how shall I catch the error? The following error is never fired.
client.on('error', function(err) {
logger.error("AVRO","Error ",err);
});
I'm not sure the connect fails when there is no server, TBH.
I found that this line:
setImmediate(() => sock.emit('error', errnoException(err, 'connect')));
always crashes the client, even if it is wrapped inside a try-catch block. I found that putting another name, e.g.
setImmediate(() => sock.emit('my error', errnoException(err, 'connect')));
everything is fine, i.e. I can catch the error.