naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
315 stars 63 forks source link

Network event and crash #258

Closed valiquette closed 8 months ago

valiquette commented 1 year ago

I noticed that when I have a network drop, I see various log messages to that effect and they all seem to handle it well and recover. But this plugin has an exception and crashes. I run a Child bridge so not a big deal but you may want to put some error handling in to cover this.

/homebridge/node_modules/homebridge-weather-plus/apis/openweathermap.js:406 callback(requestError); ^ TypeError: Cannot read properties of undefined (reading 'list') at /homebridge/node_modules/homebridge-weather-plus/apis/openweathermap.js:108:46 at Request._callback (/homebridge/node_modules/homebridge-weather-plus/apis/openweathermap.js:406:5) at self.callback (/homebridge/node_modules/homebridge-weather-plus/node_modules/request/request.js:185:22) at Request.emit (node:events:513:28) at Request.onRequestError (/homebridge/node_modules/homebridge-weather-plus/node_modules/request/request.js:877:8) at ClientRequest.emit (node:events:513:28) at TLSSocket.socketErrorListener (node:_http_client:496:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) [2/7/2023, 11:50:10 AM] [homebridge-weather-plus] Child bridge process ended [2/7/2023, 11:50:10 AM] [homebridge-weather-plus] Process Ended. Code: 1, Signal: null [2/7/2023, 11:50:17 AM] [homebridge-weather-plus] Restarting Process...

dacarson commented 8 months ago

Same as #271, which has now been fixed.