From b9701db57863ff3062190428745748e708a6120b Mon Sep 17 00:00:00 2001 From: tamasvar <41537421+tamasvar@users.noreply.github.com> Date: Wed, 11 Jan 2023 08:08:12 +0100 Subject: [PATCH 1/2] I need error msg I still need the msg.payload when there is an error, not only when everything is going well. --- storage/mysql/68-mysql.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/mysql/68-mysql.js b/storage/mysql/68-mysql.js index 87dad1b34..0698e8d90 100644 --- a/storage/mysql/68-mysql.js +++ b/storage/mysql/68-mysql.js @@ -142,6 +142,8 @@ module.exports = function(RED) { conn.query(msg.topic, bind, function (err, rows) { conn.release() if (err) { + msg.payload = rows; + send(msg); status = { fill: "red", shape: "ring", text: RED._("mysql.status.error") + ": " + err.code }; node.status(status); node.error(err, msg); From 1860182420807a4d09014cf238f6d8eeb01146b2 Mon Sep 17 00:00:00 2001 From: tamasvar Date: Thu, 2 Feb 2023 09:04:18 +0100 Subject: [PATCH 2/2] I fixed it. I thought that even if there is an error, send a message. --- storage/mysql/68-mysql.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/mysql/68-mysql.js b/storage/mysql/68-mysql.js index 0698e8d90..1bfcdfecb 100644 --- a/storage/mysql/68-mysql.js +++ b/storage/mysql/68-mysql.js @@ -142,7 +142,7 @@ module.exports = function(RED) { conn.query(msg.topic, bind, function (err, rows) { conn.release() if (err) { - msg.payload = rows; + msg.error = err; send(msg); status = { fill: "red", shape: "ring", text: RED._("mysql.status.error") + ": " + err.code }; node.status(status);