Pass msg object where possible

As described on https://nodered.org/docs/user-guide/writing-functions#handling-errors
This commit is contained in:
bvmensvoort
2023-06-14 21:50:13 +02:00
committed by Skylar Sadlier
parent 20c7182511
commit 9661922f78
19 changed files with 56 additions and 56 deletions
+2 -2
View File
@@ -32,13 +32,13 @@ module.exports = function(RED) {
}
if(!node.server.isConnected()) {
node.error("Matrix server connection is currently closed", {});
node.error("Matrix server connection is currently closed", msg);
node.send([null, msg]);
}
let roomId = node.roomId || msg.topic;
if(!roomId) {
node.error("msg.topic is required. Specify in the input or configure the room ID on the node.", {});
node.error("msg.topic is required. Specify in the input or configure the room ID on the node.", msg);
return;
}