mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fix pi gpio to catch close timing error
This commit is contained in:
parent
553ae44ccb
commit
bd15c5d6dd
@ -83,9 +83,15 @@ module.exports = function(RED) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
node.child.on('error', function (err) {
|
node.child.on('error', function (err) {
|
||||||
if (err.errno === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")); }
|
if (err.code === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")+err.path,err); }
|
||||||
else if (err.errno === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")); }
|
else if (err.code === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")+err.path,err); }
|
||||||
else { node.error(RED._("rpi-gpio.errors.error",{error:err.errno})) }
|
else { node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err) }
|
||||||
|
});
|
||||||
|
|
||||||
|
node.child.stdin.on('error', function (err) {
|
||||||
|
if (!node.finished) {
|
||||||
|
node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,11 +204,16 @@ module.exports = function(RED) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
node.child.on('error', function (err) {
|
node.child.on('error', function (err) {
|
||||||
if (err.errno === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")); }
|
if (err.code === "ENOENT") { node.error(RED._("rpi-gpio.errors.commandnotfound")+err.path,err); }
|
||||||
else if (err.errno === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")); }
|
else if (err.code === "EACCES") { node.error(RED._("rpi-gpio.errors.commandnotexecutable")+err.path,err); }
|
||||||
else { node.error(RED._("rpi-gpio.errors.error")+': ' + err.errno); }
|
else { node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err) }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
node.child.stdin.on('error', function (err) {
|
||||||
|
if (!node.finished) {
|
||||||
|
node.error(RED._("rpi-gpio.errors.error",{error:err.code}),err);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.warn(RED._("rpi-gpio.errors.invalidpin")+": "+node.pin);
|
node.warn(RED._("rpi-gpio.errors.invalidpin")+": "+node.pin);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-pi-gpio",
|
"name": "node-red-node-pi-gpio",
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"description": "The basic Node-RED node for Pi GPIO",
|
"description": "The basic Node-RED node for Pi GPIO",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user