3

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.

fadedbee
  • 42,671
  • 44
  • 178
  • 308

1 Answers1

-1

You can try to use longjohn https://github.com/mattinsler/longjohn to get longer stack traces for your exception.

edtech
  • 1,734
  • 20
  • 20