AlCalzone / node-tradfri-client

Library to talk to IKEA Trådfri Gateways without external binaries
MIT License
264 stars 30 forks source link

UnhandledPromiseRejectionWarning while pairing #603

Open willemx opened 2 years ago

willemx commented 2 years ago

While trying to pair a control outlet plug to the gateway, I got this error message on the console:

W20220417-18:13:14.499(2)? (STDERR) (node:6835) UnhandledPromiseRejectionWarning: Error: unexpected response (4.04) to observeScenes(131085): [object Object]
W20220417-18:13:14.499(2)? (STDERR)     at TradfriClient.handleNonSuccessfulResponse (/Users/willem/meteor/ctrlh/node_modules/node-tradfri-client/build/tradfri-client.js:793:32)
W20220417-18:13:14.499(2)? (STDERR)     at TradfriClient.<anonymous> (/Users/willem/meteor/ctrlh/node_modules/node-tradfri-client/build/tradfri-client.js:584:27)
W20220417-18:13:14.500(2)? (STDERR)     at Generator.next (<anonymous>)
W20220417-18:13:14.500(2)? (STDERR)     at /Users/willem/meteor/ctrlh/node_modules/node-tradfri-client/build/tradfri-client.js:8:71
W20220417-18:13:14.500(2)? (STDERR)     at new Promise (<anonymous>)
W20220417-18:13:14.500(2)? (STDERR)     at __awaiter (/Users/willem/meteor/ctrlh/node_modules/node-tradfri-client/build/tradfri-client.js:4:12)
W20220417-18:13:14.500(2)? (STDERR)     at TradfriClient.observeScenes_callback (/Users/willem/meteor/ctrlh/node_modules/node-tradfri-client/build/tradfri-client.js:581:16)
W20220417-18:13:14.500(2)? (STDERR)     at PendingRequest.callback (/Users/willem/meteor/ctrlh/node_modules/node-tradfri-client/build/tradfri-client.js:575:99)
W20220417-18:13:14.501(2)? (STDERR)     at Function.onMessage (/Users/willem/meteor/ctrlh/node_modules/node-coap-client/build/CoapClient.js:635:33)
W20220417-18:13:14.501(2)? (STDERR)     at SocketWrapper.emit (events.js:400:28)
W20220417-18:13:14.501(2)? (STDERR)     at SocketWrapper.emit (domain.js:475:12)
W20220417-18:13:14.501(2)? (STDERR)     at Socket.<anonymous> (/Users/willem/meteor/ctrlh/node_modules/node-coap-client/build/lib/SocketWrapper.js:14:18)
W20220417-18:13:14.501(2)? (STDERR)     at Socket.emit (events.js:400:28)
W20220417-18:13:14.501(2)? (STDERR)     at Socket.emit (domain.js:475:12)
W20220417-18:13:14.502(2)? (STDERR)     at Socket.udp_onMessage (/Users/willem/meteor/ctrlh/node_modules/node-dtls-client/build/dtls.js:195:34)
W20220417-18:13:14.502(2)? (STDERR)     at Socket.emit (events.js:400:28)
W20220417-18:13:14.502(2)? (STDERR) (Use `node --trace-warnings ...` to show where the warning was created)
W20220417-18:13:14.502(2)? (STDERR) (node:6835) 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: 6)
W20220417-18:13:14.503(2)? (STDERR) (node:6835) [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.
AlCalzone commented 2 years ago

Is this reproducible? I've had similar reports from time to time, but AFAIK none of them were.

willemx commented 2 years ago

No, can’t reproduce; second pairing attempt succeeded without errors.