In a workflow, I have a block with a control path for error handling which then posts to a Slack channel. In the Run History, the workflow shows as success. I'm not surprised because the "error" got handled. But a failure did occur, we just wanted to report it from the workflow. Is there any thing I can put in the workflow to make it be "failure" in the Run History?
if your not worried about the response at all when there's an error you could just put malformed JSON in a Response block. everytime it goes down that path now, you're guaranteed an error... just not necessarily the original one (you could also try {{ throw Error("whoops") }}
in a Code block instead of a Response one, it should notify javascript (JRE) there's an error which could tell retool)
Thank you for the suggestions. But in some cases our workflows are called from external services through a webhook trigger. We'd like to return error responses to the caller.
I was surprised to see that a error response that is not 200 did not log as an error in the run history
ya i guess its confusingly using "error" in the programmer sense of 'there were no run-time errors' instead of the network way of 'i don't care what you're saying now cause the paper trail says 500 so here's your error'
I assume you're currently handling the error as shown below?
Does it work for you to instead use a global error handling block that is disconnected from the main flow of your workflow?
Depending on your use case, a clear downside would be losing the ability to handle errors in a granular fashion, but I did verify that it causes the run to show up as a "Failure" in history.
Hopefully this workaround is something that works for you! I'll definitely talk to our team about updating the way we display historical runs in which errors were caught and handled.
following @Darren's line of thought, maybe try creating a function to complete whatever task and calling it from a block and/or using Python (feel free to post JS and ask for a Python version or vice versa)
Yes, we did discover that a global error handler does report as "failure" in the Run History even though the error is "handled" and that's exactly what we want. And that has improved our workflow troubleshooting quite a bit.