nfarina / homebridge-sonos

Sonos plugin for homebridge: https://github.com/nfarina/homebridge
155 stars 52 forks source link

Not Catching Errors When Device Is Disconnected #26

Closed mattnewham closed 8 years ago

mattnewham commented 8 years ago

Looks like you are not catching errors when a device is disconnected from the network (dropout or power out):

Disconnecting the speaker I get:

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

Error: connect EHOSTUNREACH 192.168.60.122:1400
    at Object.exports._errnoException (util.js:896:11)
    at exports._exceptionWithHostPort (util.js:919:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1073:14)

Should probably catch this and handle gracefully

mattnewham commented 8 years ago

Already referenced bencevans/node-sonos#121