I'm trying to create an error handler workflow and noticed an odd behavior I cannot understand. In the following example I'm simplifying my workflow as much as possible to reproduce my issue.
I'll show 2 workflows. The first one, called buggy, is the main workflow throwing an error:
![buggy.PNG]()
I use the Default error handler with a workflow called handle error to react on errors.
Here is how handle error looks like:
![handle error.PNG]()
This flow is also throwing an error, and I try to handle it with another Default error handler. But this is not working, if I run buggy, I end up in an infinite loop:
[2019-04-06 22:33:12.314] [E] Error in (Workflow:buggy / Throw error (item1)#0) bug1
[2019-04-06 22:33:12.375] [I] Don't worry, I'll take care of bug1
[2019-04-06 22:33:12.392] [E] Error in (Workflow:handle error / Oops (item2)#0) Oops
[2019-04-06 22:33:12.429] [I] Don't worry, I'll take care of Oops
[2019-04-06 22:33:12.444] [E] Error in (Workflow:handle error / Oops (item2)#0) Oops
[2019-04-06 22:33:12.482] [I] Don't worry, I'll take care of Oops
[2019-04-06 22:33:12.501] [E] Error in (Workflow:handle error / Oops (item2)#0) Oops
[2019-04-06 22:33:12.547] [I] Don't worry, I'll take care of Oops
[2019-04-06 22:33:12.564] [E] Error in (Workflow:handle error / Oops (item2)#0) Oops
[2019-04-06 22:33:12.598] [I] Don't worry, I'll take care of Oops
This was the only way to make handle error work:
![handle error 2.PNG]()
And the resulting (desired) logs:
[2019-04-06 22:53:55.027] [E] Error in (Workflow:buggy / Throw error (item1)#0) bug1
[2019-04-06 22:53:55.076] [I] Don't worry, I'll take care of bug1
[2019-04-06 22:53:55.125] [I] Ignoring Oops
So the goal is catch errors in the handle error flow itself. My real handle error flow is much more complex and I did not like this workaround of setting the error path of each step. I prefer a nested Default error handler but I could not make it behave.
Any ideas?