mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #243 from TJKoury/change_file_node
Change to error handling in 50-file.js to pass on msg.error.
This commit is contained in:
commit
9d2864088b
@ -81,10 +81,11 @@ module.exports = function(RED) {
|
|||||||
fs.readFile(filename,options,function(err,data) {
|
fs.readFile(filename,options,function(err,data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
node.warn(err);
|
node.warn(err);
|
||||||
|
msg.error = err;
|
||||||
} else {
|
} else {
|
||||||
msg.payload = data;
|
msg.payload = data;
|
||||||
node.send(msg);
|
|
||||||
}
|
}
|
||||||
|
node.send(msg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user