Open rcarmo opened 5 years ago
Hi,
I got the same problem today:
18 Dec 11:45:46 - [error] [azureiothub:Azure IoT Hub] Could not connect: Connection refused: Not authorized
18 Dec 11:45:46 - [red] Uncaught Exception:
18 Dec 11:45:46 - TypeError: Cannot read property 'sendEvent' of undefined
at sendData (/persistent/storage/node_modules/node-red-contrib-azure-iot-hub/azureiothub.js:38:16)
at /persistent/storage/node_modules/node-red-contrib-azure-iot-hub/azureiothub.js:86:21
at /persistent/storage/node_modules/azure-iot-device/lib/client.js:240:9
at Mqtt.<anonymous> (/persistent/storage/node_modules/azure-iot-device-mqtt/lib/mqtt.js:45:17)
at MqttClient.errCallback (/persistent/storage/node_modules/azure-iot-mqtt-base/lib/mqtt.js:75:7)
at MqttClient.emit (events.js:327:22)
at TLSSocket.f (/persistent/storage/node_modules/once/once.js:25:25)
at TLSSocket.onfinish (/persistent/storage/node_modules/end-of-stream/index.js:31:27)
at TLSSocket.emit (events.js:315:20)
at finishMaybe (_stream_writable.js:639:14)
at ShutdownWrap.callback (_stream_writable.js:616:5)
at ShutdownWrap.afterShutdown [as oncomplete] (net.js:432:8)
It seems the node doesn't catch errors like it should (see https://nodered.org/docs/user-guide/handling-errors#uncatchable-errors).
The problem is that Node-RED quits because of this error.
Is it something that can be fixed?
Thanks, Adrien
I'm coming across a situation where the node should report an error without crashing the entire Node-RED process:
This happens when I don't have a
SharedKey
defined for the connection andundefined
gets passed to the node: