rudders / homebridge-http

HTTP Plugin for Homebridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When there is a error on the endpoint of the http status it will break homebridge

bgoncal opened this issue · comments

If there is for some reason an error with the status endpoint like the url is not available or is not returning what is expected, the plugin crash the homebridge, this is a really really terrible situation

I'm having the same issue. Here's the error log:

[11/18/2018, 6:48:08 AM] [Dining Table Light] HTTP get power function failed: read ECONNRESET
/opt/node/lib/node_modules/homebridge-http/index.js:45
		                callback(error);
		                ^

ReferenceError: callback is not defined
    at /opt/node/lib/node_modules/homebridge-http/index.js:45:19
    at Request._callback (/opt/node/lib/node_modules/homebridge-http/index.js:115:4)
    at self.callback (/opt/node/lib/node_modules/homebridge-http/node_modules/request/request.js:185:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Request.onRequestError (/opt/node/lib/node_modules/homebridge-http/node_modules/request/request.js:881:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)

This was fixed in #61, but when installing from NPM, an old version is downloaded.

Is there any way to have the package in NPM updated? It's showing as not having been changed in 3 years: https://www.npmjs.com/package/homebridge-http