Add the ability to throw an Exception.
You should be able to fail a Logic App on purpose. This way you can build enterprise integration patterns to check responses of other systems and let the Logic App fail if necessary.
Cristián Cámpora Guajardo commented
I was also looking for this but is open for more than 3 years so I don't hold hope on it.
Workaround: Just use whatever action available and make it fail intentionally. For example if you call a Store Procedure that doesn't exist using the SQL node you will get your exception for sure.
Ivan Kukic commented
This would be a great addition for advanced error handling.
An idea might be to add a Throw Exception action, that fails the scope it's in (or the global LA if it's not in a scope) with the failure reason stated in the Throw Exception action.
This would enable something like a try with multiple different catch blocks, so we can control the flow after the exception depending on the exception that was thrown.
For a workaround, we currently use an assign variable action, where the variable is of type int and we assign a string value to it which obviously causes an error. Throw Exception would be a more elegant solution, so that we don't have to resort to such hacks.
J Ludwig commented
Terminate action is great, but termination prevents global error handling on scope output.
Let's say you got a scope with 3 tasks A, B and C. If A fails, B runs otherwise C does. Whenever A fails, scope is always successful and you fail to access error handling based on run after scope Failed status, since scope status is equal to last action status.
We should be able to run a ThrowException task right after B.
Jerzy Sidoruk commented
but how to fail a Scope? or for example Switch action on Default?
Preetham Vinod[MSFT] commented
There is a terminate action currently which can be used to fail a logic app.