PSeitz / yamaha-nodejs

A node module to control your yamaha receiver
MIT License
123 stars 32 forks source link

Error: socket hang up #7

Closed SphtKr closed 8 years ago

SphtKr commented 8 years ago

Hitting an error based on some weird network condition, but I'm not sure how to catch this since it's asynchronous:

/usr/local/lib/node_modules/homebridge-yamaha/node_modules/yamaha-nodejs/node_modules/deferred/_ext.js:75
                        throw this.value;
                                  ^
Error: socket hang up
    at createHangUpError (_http_client.js:215:15)
    at Socket.socketOnEnd (_http_client.js:300:23)
    at Socket.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

You can see the downstream code here; it's possible that it's not defining an error callback in some case and that could be the problem...do you know if this should be properly caught if an error callback is always provided? Or is this something that needs to be (or can't easily be) caught at the yamaha-nodejs level?

SphtKr commented 8 years ago

Heh...never mind. Added failure callbacks in all cases and now the error is being caught. Thanks for your work!