exception – Node-Red – How to catch errors from Write File Node?
If the LOG_FILE_PATH env var is empty then the file-write node will only print a warning message to the debug sidebar and no error will be thrown for the catch node to receive.
If the path points to a location or file that the user running Node-RED can not access, then it will throw an exception on the first message only, it will not continue to throw errors for every input message, so it will not be possible to send a 500 error for every request.
It also appears that file-write node outputs even if it throws an error so the http-response node will already have responded by the time the output of the catch node reaches it.
You may want to raise this on the Node-RED Discourse forum to discuss a feature request to change this behaviour as it’s probably sub-optimal
Read more here: Source link
