Hey apologies if this is a very noob question, but I was wondering what the best practice is for handling expected errors. I have a few queries that will run in my workflow and sometimes return a 401 error - no records matching query. This is expected since I run this job every hour and if there are no updates, it's very common that there will be nothing that gets returned. I want to handle this so my workflow doesn't show that it's erroring out every time I run it. Is there a best way to handle this? By handling it, I'll also be able to reenable my global error handler which has been very noisy given the regular 401 errors. Thanks!
Hi @tiffany! Thanks for reaching out - not an obvious question, at all.
It's a little hidden, but there's setting called Finally
that you can define on every block. The default value is Exit
, which means that the entire workflow stops running and looks for a global error handler. Setting it to Continue
instead exposes a new error-handling pathway that is unique to that block.
I hope that helps! Let me know if you have any follow-up questions.
Hi @Darren thanks for getting back to me! I realized that each block has a success/error state (green and red dots) and that both of them need a handler. I was only handling the success state and had a global error handler for everything else. I also enabled the "Finally" condition to Continue
as suggested above. It works and runs exactly as expected! Thanks!