lukasroegner / homebridge-tado-smart-thermostat

Plugin for using Tado devices in homebridge.
MIT License
13 stars 4 forks source link

UnhandledPromiseRejectionWarning: Error #12

Closed bxlouis closed 4 years ago

bxlouis commented 4 years ago

Hello @lukasroegner,

I noticed recently that Homebridge logs throw this warning repeatedly. The plugin seems to work correctly but I get loads of these error messages.

(node:28533) UnhandledPromiseRejectionWarning: Error: Response Error: 504 Gateway Time-out at internals.Client._shortcut (/homebridge/node_modules/homebridge-tado-smart-thermostat/node_modules/wreck/lib/index.js:635:11) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) at Object.request (/homebridge/node_modules/homebridge-tado-smart-thermostat/node_modules/simple-oauth2/lib/core.js:64:20) at AccessToken.refresh (/homebridge/node_modules/homebridge-tado-smart-thermostat/node_modules/simple-oauth2/lib/access-token/index.js:35:24) (node:28533) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 78)

Cardo1 commented 4 years ago

I see this whenever my internet is down. Seems to be a connection problem with the tado server?

lukasroegner commented 4 years ago

Indeed, those errors occur due to the Tado server being down (HTTP status 504). Those errors are not handled by the library the plugin uses to communicate with the API, thus the errors cannot be removed. As they are not causing homebridge to shut down and issues on the Tado server-side should be rare, they can be ignored.