howanghk / homebridge-ewelink

Homebridge plugin to control Sonoff relays with OEM firmware
MIT License
81 stars 46 forks source link

Homebridge crash while no internet available #98

Closed BreitiDE closed 4 years ago

BreitiDE commented 4 years ago

hi, cool plugin, works great as long as there is an existing internet connection. I got a homebridge crash if my router reboots.

[4.6.2020, 14:13:42] TypeError: Cannot read property 'statusCode' of undefined
    at /usr/local/lib/node_modules/homebridge-ewelink-max/index.js:1042:44
    at Object.parseBody (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/request-json/main.js:74:12)
    at Request._callback (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/request-json/main.js:148:26)
    at self.callback (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/local/lib/node_modules/homebridge-ewelink-max/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
bartgabriels commented 4 years ago

I had the same yesterday