javascript - How to find the source of a connect ECONNREFUSED error in node.js? -
i've inherited nodejs application reasonable complexity. interacts 5 other applications through various network interfaces, http rest apis. every , run issue error thrown, , while handled prevent application crashing, can't tell error coming from. here's typical amount of information error:
- connect econnrefused
- util.js:l746
- net.js:1000
and that's it. that's entire message , stacktrace (message duplicated in errno=econnrefused
, syscall=connect
, not helping). i'm using nodejs 0.12.2 , linked stacktrace lines source accordingly. i've read source didn't anywhere.
i've looked through many questions here on related econnrefused
, come code example. if knew part of applicatino response network request, fix it.
so question is, how can instrument node application find out failed requests come from?
ps: i've looked @ the recommendations debugging nodejs applications, didn't find answering question.
the error caused tcp connection coming kernel refused host - need error handling , retry attempts avoid problems. try curl
ing url make sure it's not wrong machine.
you can use domain module encapsulate code , make sure preserve context in error took place. in addition, should make named functions callbacks , because @ least point in right direction.
there libraries out there can attempt retry http requests , if that's need.
Comments
Post a Comment