peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.19k stars 145 forks source link

terminates with Error: socket hang up in q.js:126 #81

Closed gjniewenhuijse closed 8 years ago

gjniewenhuijse commented 8 years ago

/usr/local/lib/node_modules/homebridge-philipshue/node_modules/node-hue-api/node_modules/q/q.js:126 throw e; ^

Error: socket hang up at createHangUpError (_http_client.js:203:15) at Socket.socketOnEnd (_http_client.js:288:23) at emitNone (events.js:72:20) at Socket.emit (events.js:166:7) at endReadableNT (_stream_readable.js:903:12) at doNTCallback2 (node.js:439:9) at process._tickCallback (node.js:353:17)

I may have found a solution for this.

For the node-hue-api you need to have error handling like this: var displayError = function(err) { console.error(err); }; api.setLightState(8, hueState) .then() .fail(displayError) .done();

peter-murray commented 8 years ago

Sorry, what is it that you reporting here?

Is it that you managed to generate an error and you fixed it by adding a fail to the promise chain, or something else?

You don't provide me anything to go on here, can you please elaborate and give me an example of the code you are calling that generates the error?