<aside> 💡 Do you know that you can use the action On block error as the exception handler for the entire desktop flow?

</aside>

Problem Description

Power Automate for desktop enables you to handle errors at the action level through the On error functionality:

Untitled

In addition, you can also implement error handling for a group of actions through the action On block error:

Untitled

However, it is not obvious how exception handling can be applied to the entire desktop flow to ensure that any and all errors will be caught and handled.

Solution

To create an exception handler for the entire desktop flow, you can apply the action On block error to the entire Main flow:

Untitled

When an error occurs, the subflow FlowExceptionHandler will be triggered:

Untitled

Untitled

The subflow FlowExceptionHandler will retrieve the last error that occurred in the Main flow:

Untitled

Note that you need to specify what happens thereafter, e.g. send an email notification to inform the user about the error.

Additional Information