Exception hierarchy

Hello,

I would say that BRE will not be catch if you’re expecting ApplicationException but will be catch as Exception, ApplicationException will not be catched as BRE but will be catch as Exception too.

GetType(ApplicationException).IsAssignableFrom(GetType(BusinessRuleException)).ToString
False

GetType(BusinessRuleException).IsAssignableFrom(GetType(ApplicationException)).ToString
False

GetType(Exception).IsAssignableFrom(GetType(ApplicationException)).ToString
True

GetType(Exception).IsAssignableFrom(GetType(BusinessRuleException)).ToString
True

1 Like