Tom-Hirschberger/MMM-SynologySurveillance

Unhandled Promise Exception on position change

Closed this issue · 1 comments

With node version 16.3.1 the module throws a exception if the position is changed:

[21.07.2023 19:16.53.775] [ERROR] (node:1033) 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: 26)
[21.07.2023 19:17.13.762] [ERROR] (node:1033) UnhandledPromiseRejectionWarning: ReferenceError: Sleep is not defined
    at Class.goPosition (/home/pi/MagicMirror-stable/modules/MMM-SynologySurveillance/node_helper.js:270:7)
    at Class.socketNotificationReceived (/home/pi/MagicMirror-stable/modules/MMM-SynologySurveillance/node_helper.js:332:12)
    at Socket.<anonymous> (/home/pi/MagicMirror-stable/js/node_helper.js:104:11)
    at Socket.emit (node:events:513:28)
    at Socket.emitUntyped (/home/pi/MagicMirror-stable/node_modules/socket.io/dist/typed-events.js:69:22)
    at /home/pi/MagicMirror-stable/node_modules/socket.io/dist/socket.js:703:39
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
[21.07.2023 19:17.13.763] [ERROR] (node:1033) 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: 27)

With node Version 18.X to problem is gone.

fixed with version 0.1.3