I want to use the Pushover Node to send notifications. I'm already using it via curl for some time and very seldom some messages aren't sent. Thats why I have in bash
echo "$curlOutput" | grep -qP '{"status":1'
if [ ! $? -eq 0 ]
then
echo "$2" | mail --append "Content-Type: text/plain; charset=UTF-8" -s "$1" name@company.com
fi
to capture the error and then send the message via email.
Now I want to do something similiar in Node-Red. For testing purposes if simulated a network error via sudo iptables -A OUTPUT -d 104.20.0.0/16 -m comment --comment "Pushovertest" -j REJECT
That successfully blocks. In node-red-log I see
18 May 13:46:24 - [error] [pushover:252a17dc.1239d8] Error: connect ECONNREFUSED 104.20.125.71:443
Now look at this Node-RED flow
The error is displayed in the debug window and comes from pushover node. The catch node doesn't catch the expection, obviously because pushover doesn't use the exception framework https://developer.ibm.com/recipes/tutorials/nodered-exception-handling-framework/
First test passed: There is an error logged. But how can I react to this error within Node-RED to do something else in this case?