Difference between System.Exception and “General Exception” in BizTalk

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 C# software 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. More about General Exception here.

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.

Follow me:

Leave a Reply

Your email address will not be published. Required fields are marked *