Daniel-t / node-red-contrib-aws

A collection of Node-RED nodes for AWS.
Apache License 2.0
57 stars 59 forks source link

Shouldn't kill the flow in all cases #52

Closed bkems closed 6 years ago

bkems commented 6 years ago

I called GetObject and the key was not found. The flow terminates. That's a bit unfriendly, IMO. Perhaps some functions should terminate the flow, but I don't think things that may be dynamically set during runtime (eg filenames/Keys) should handle error states by terminating the flow.

Daniel-t commented 6 years ago

This would be a breaking change for many people. However I see the value. How about an option (per node) to have either the current behaviour (default) or return the error object.

This would need to be done in the build script and applied to all nodes.

bkems commented 6 years ago

Yes, that would be a good enhancement. I'm happy to help implement that if you'd like?

Daniel-t commented 6 years ago

Another thought this morning. This could also be handled by having a second output port on each node that would only be used in the event of an error.

This would mean users wouldn’t need a seperate switch node to determine the logic to use. I’m leaning this way at present but happy to discuss.

If you want to implement this, happy for you to do so, please just submit the pull request with only changes to the build scripts (not all nodes updated) in the first instance.

Daniel-t commented 6 years ago

I've just pushed a new batch which should resolve this, turned out to only be about 3 lines of code. Give it a go an let me know.

bkems commented 6 years ago

Awesome, will do. Thanks. Sorry I wasn't any help in fixing it myself, a bit too much on at the moment!