Difference between System.Exception and "General Exception" in BizTalk

Published on 11 October 2016

BizTalk orchestration's exception system

In BizTalk orchestration we can catch 2 different types of exceptions:

  • System Exception - deriving from System.Exception

  • General Exception - not deriving from System.Exception

System.Exception and "General Exception"

As a Csoftware engineer you know that all system and custom exceptions have to inherit System.Exception. And that is absolutely true.... for C#. It turns out that in .NET also other types can act as exceptions. They are called General Exceptions.

When to use it?

Rule of thumb says: "Catch only exceptions you can handle". Like Delivery Failure Exception.

If you want to catch all exceptions catch "General Exception". This will also catch the exceptions from external .NET Components - regardless of their language

I do not recommend catching System.Exception since it does not catch all exceptions in BizTalk context. It is also a symptom of bad programming practices.'

comments powered by Disqus