Skip to content
Code On!

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

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

1min read

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

  • System Exception - deriving from System.Exception

  • General Exception - not deriving from System.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.

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.