I have a NodeJS program with many complex dependencies.
It was occasionally crashing with EHOSTUNREACHABLE
, so I added a process.on('uncaughtException' ...
handler.
Neither the original crash, nor the caught error give any indication of where the problem occurs, as it is an async exception, thrown from NodeJS code (rather than application code).
{ [Error: connect EHOSTUNREACH]
code: 'EHOSTUNREACH',
errno: 'EHOSTUNREACH',
syscall: 'connect' }
Is there a way of finding more details via the syscall which NodeJS is making? Ideally, I would like to know the remote IP address which is unreachable.