Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BizTalk scope "Catch Exception" General Exception message

I have a BizTalk (2006 R2) scope with a "Catch Exception" part in which I have put a simple Expression shape to store the exception message in an orchestration variable.

The problem is that if I choose the exception type to be "General Exception" then I do not get to supply an exception object name. Where do I retrieve exception info in this situation?

Then I thought I would just choose the exception type as System.Exception but that is not possible. I can only select more specific .NET exception types.

Am I doing it wrong or is this how BizTalk works?

like image 977
lox Avatar asked Jun 08 '09 10:06

lox


3 Answers

Think of catching a "Generic Exception" as the equivalent of doing a "catch { }" block in C# with no exception declared. So, yes, there's no way to get the exception message at that point because the exception that comes up might (potentially) be an object not derived from System.Exception.

I'm not sure what you mean, though, when you say that you cannot choose System.Exception as the exception type to catch. You can most certainly do that and I've done it several times in the past. Heck, just tried it again and it's there.

Are you getting any errors? Is it not appearing in the type selection dialog?

like image 97
tomasr Avatar answered Oct 29 '22 22:10

tomasr


The difference between the two methods is that one gives you a handle to the exception object and the other does not. You should select "General Exception" when you do not need the information contained in the Exception object. Otherwise you can select the System.Exception class from mscorlib.

like image 27
Slugart Avatar answered Oct 30 '22 00:10

Slugart


My friend you can choose exception type "System.Exception", just click assembly "mscorlib" on left panel, then click on namespace "System", in the right side will appear (alphabetically ordered) mscorlib's classes names, scroll down and you will see "System.Exception".

I hope that helps you...

Greetings

like image 29
Francisco J. Rodríguez Avatar answered Oct 29 '22 22:10

Francisco J. Rodríguez