Which System Exception?
I'm almost embarrassed to post this one, but it send me chasing windmills for a couple of hours, so if I can save that from any other unfortunate person it served a purpose I guess -
I have a call from one orchestration to another.
In the calling orchestration I wanted to catch any exception that would occur on the called orchestration (or anywhere else down the line) and so I swiftly wrapped the call in a non-transactional scope and added an exception handler.
Being the keyboard-fan that I am (BizTalk is completely unfriendly to us keyboard types, but still...) when the type selector opened I did what I always do - I types the name of the class I wanted (System.Exception) and pressed enter.
The problem was that I did not type the class name ('Exception') but the full name ('System.Exception') and that got me System.SystemException class as the selected type, only that I did not realise that at the time. apparently the type selector ignores special characters being keyed in?!
It was much later that I realised exceptions that were thrown in my called orchestration were not being caught in the calling one and even then it took me a good couple of hours to realise what was the reason (I simply did not look carefully enough at the exception type - System.SystemException just looks like System.Exception when you (well - I) glance at it!
Three take ways for me -
- Pay more attention when doing even the most trivial tasks. (trivial, isn't it?)
- Consider being less zealous about using the keyboard when doing BizTalk development
- But seriously - consider always having a general exception handler to catch whatever exceptions were not caught by other handlers. I should have been mostly covered by catching System.Exception (although BizTalk, unlike C# or VB.net does support exceptions that do not inherit from System.Exception, see Charles Young post on the subject), but this could have helped at least identify the problem.
Labels: BizTalk, exception, orchestration
2 Comments:
Hi Yossi,
How did it escape the compiler? Surprised!! I haven't tested it myself, did the build succeeded without any errors?
By
Saravana Kumar, at 21/07/2008, 10:14
Shouldn't bother the compiler - I simply ended up with an exception handler for the wrong Exception -
I was handling System.SystemException (which was never thrown, and therefore never got caught...) when I intended to handle System.Exception which would have caught most Exceptions.
By
Yossi Dahan, at 21/07/2008, 15:48
Post a Comment
<< Home