The value of decent & descriptive exception messages and the BizTalk adapter for BizTalk 2006. - A world apart from the everday ...

A world apart from the everday ...

Assert.IsTrue(Entries.Count == 0);

The value of decent & descriptive exception messages and the BizTalk adapter for BizTalk 2006.

I am currently working on this really cool integration project where I'm automating a number of business processes using BizTalk orchestrations.

The data comes in through a variety of sources and trading partners and ultimately gets pumped in Microsoft Dynamics CRM 3.0 using the adapter built by MS.

One of the gotchas that I ran into was on create / update I was getting an error coming back from CRM saying the following:

"Error Description: Input Xml is having some invalid attributes"

Marvelous! Thanks for that. Any idea which attribute is invalid? Any clues, hints would be really nice!

After digging around a bit I discovered that you can turn on debugging for this adapter by modifying a key in the registry.

“HKEY_CLASSES_ROOT\CLSID\{D38D5DCC-2B30-43b9-9C69-3BBFD0926986}”

Set the "Debug" key to true and also set the "LogPath" key to the path where you want your log files to be created; make sure your BizTalk host instance has write access to this folder, restart your host instance and hey ... presto ... out pops a log file with a message that looks similar to the following:

Attribute <new_company> has invalid datatype. 70056723456 received. Expected boolean.

Great, now I know exactly where to look and what to do. A simple 1 second fix and all my problems are gone. (ok maybe not all, but this specific one)

What I would love to know with tears in my baby blue eyes is why the exception message returned by the adapter did not originally include this detail. Why only if we're running in debug?

That would have saved me a few hours of digging and hunting around.

I guess this extends beyond just the CRM Adapter for BizTalk but on to development in general. In today's day and age is it acceptable to return "descriptive" and "useful" exception messages like this?

All too often I see throw new Exception("An error occurred."); it is a kin to sending a developer a screenshot of a message box when an error occurs and expecting them to know immediately where and why the error occurred just this once and never again ....

Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: