Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle connect errors #3

Open
ghost opened this issue Oct 3, 2016 · 0 comments
Open

Gracefully handle connect errors #3

ghost opened this issue Oct 3, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 3, 2016

I'm using the api as per the example but I'm running 5 instances.

var hikvision1 = new ipcamera.hikvision(options1);
var hikvision2 = new ipcamera.hikvision(options2);
etc ...

It works well but this morning one of my cameras stopped responding. It caused my javascript to exit with the following error:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: connect EHOSTUNREACH 192.168.2.24:80
    at Object.exports._errnoException (util.js:907:11)
    at exports._exceptionWithHostPort (util.js:930:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1077:14)

It resulted in that monitoring of all my 5 cameras ceased working. Can the code be altered in some way to gracefully handle a connection error without crashing my javascript?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants