Allowing unreachable exception

This a unreachable code,the studio should not allow it . I could make mistake but i think workflow should not compile.

1 Like

It actually isn’t, although I thought the same up to this topic:

1 Like

Check this example. You will see that the second catch gets fired even if the System.Exception catch is first. (2.1 KB)

1 Like

I have tested the attached file ,

Test the attached file .

I am trying to read a file which does not even exists .

Typically speaking this should return the IO exception rather than Exception .

My knowledge is limited so i checked with below article .

IOException Class (System.IO) | Microsoft Learn.

I am not able to send attachment .


  1. Drop a read file activity
  2. In Read file activity put the drive name as "“INMOON:\text.txt”.
  3. Add the Exception and beneth that add Msgbox with any content
    4)Add the IO Exception and beneth that add Msgbox with any content
    Test it .

For your reference :

I’ve tested this myself and the exception you’re actually getting is AggregateException. This is because the Read text file activity is apparently programmed to try reading up to three times and, if it fails, throw all three exceptions as one. Because you have no specific catch clause for this exception type, it will be handled by its most direct ancestor’s clause, which is Exception in your example.