You can test if an individual action within the Flow fails.
In the ... for each action, there is a "Configure run after" option.

Inside here, you can set when the selected action will run based on the previous action. In the below example, this is a normal setup where the delete email action runs if the rename file action succeeds.

You could instead, uncheck "is successful" and check of "has failed" and/or "has timed out". This branch will then only run if the previous action failed or timed out.