A quick tip. The Throw shape in BizTalk can cause a little initial confusion. The shape has an 'Exception Object' property which you assign using a drop-down list. When you first drag the shape onto your Orchestration, the only item in the list is 'General Exception'. Intuitively, you might expect that you can select an exception class, in a similar fashion to setting the 'Exception Object' property of a Catch Exception block. However, this is not the case. If you wish to throw a specific exception, you will need first to create a variable of an exception type (or use the exception object defined in a Catch Exception block). This variable will then be displayed in the drop-down list of the 'Exception Object' property. There is no need to write code to instantiate the object, as it will be automatically instantiated. However, you may wish to include expression code to set property values.
You can only use 'General Exception' if the Throw statement is placed in a Catch Exception block - i.e., you are rethrowing an exception. I did some testing, and it appears that this is essentially the meaning of setting 'General Exception' on a Throw shape. It rethrows the existing exception object, as is. The exception is raised by calling an inherited method of the BizTalk Context class.
When catching exceptions, choosing 'General Exception' as the Exception Object allows Catch Exception blocks to handle exceptions which are not derived from System.Exception. The .NET framework allows any class to be raised as an exception, but some .NET languages such as C# impose a tighter restriction that exceptions must be System.Exception classes. 'General Exception' allows BizTalk to deal with any exception it may catch (and rethrow) from an external .NET component, regardless of the language that component was written in.
[UPDATE] In most scenarios, the use of General Exception in a catch block is now redundant in BTS 2006 and later. Since CLR 2.0, whenever an exception is thrown, and that exception is not derived from System.Exception, the CLR automatically wraps the exception in an instance of the System.Runtime.CompilerServices.RuntimWrappedException class. By default, the C# compiler, used by BizTalk to compile orchestration code, is compiled with the following Assembly attribute:
The parameter name is slightly misleading. When set to true, C# does not automatically unwrap instances of RuntimWrappedException. When set to false, it does.
In BizTalk Server 2009, it is simple to manually set WrapNonExceptionThrows to false in the Assembly code file. In this case, non-System Exceptions could be caught by General Exception. However, in normal circumstances, all exceptions will be caught as System.Exceptions. The only remaining use of a general exception catch block is as the equivalent of a 'catch' in C# without an explicit exception type.