When upon running the command node devices.js no Tradfri gateway is found (e.g., because it is switched off), then the stack trace of an exception is written to the console:
Looking up IKEA Tradfri gateway on your network
(node:10990) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'host' of null
at Object.getConnection (/home/michi/tradfri-cli/connection.js:13:41)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:10990) 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(). (rejection id: 1)
(node:10990) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This might confuse less experienced users, so it would be preferable when an error message like No Tradfri gateway found in local network would appear in this case.
When upon running the command
node devices.js
no Tradfri gateway is found (e.g., because it is switched off), then the stack trace of an exception is written to the console:This might confuse less experienced users, so it would be preferable when an error message like
No Tradfri gateway found in local network
would appear in this case.