mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
let mysql report errors to catch node
This commit is contained in:
parent
2ef447dfeb
commit
e1b02c90dd
@ -46,7 +46,7 @@ module.exports = function(RED) {
|
||||
node.connection.connect(function(err) {
|
||||
node.connecting = false;
|
||||
if (err) {
|
||||
node.warn(err);
|
||||
node.error(err);
|
||||
node.tick = setTimeout(doConnect, reconnect);
|
||||
} else {
|
||||
node.connected = true;
|
||||
@ -103,7 +103,7 @@ module.exports = function(RED) {
|
||||
//console.log("query:",msg.topic);
|
||||
var bind = Array.isArray(msg.payload) ? msg.payload : [];
|
||||
node.mydbConfig.connection.query(msg.topic, bind, function(err, rows) {
|
||||
if (err) { node.warn(err); }
|
||||
if (err) { node.error(err,msg); }
|
||||
else {
|
||||
msg.payload = rows;
|
||||
node.send(msg);
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name" : "node-red-node-mysql",
|
||||
"version" : "0.0.6",
|
||||
"version" : "0.0.7",
|
||||
"description" : "A Node-RED node to read and write to a MySQL database",
|
||||
"dependencies" : {
|
||||
"mysql" : "2.7.*"
|
||||
"mysql" : "2.9.*"
|
||||
},
|
||||
"repository" : {
|
||||
"type":"git",
|
||||
|
Loading…
Reference in New Issue
Block a user