1 out of 1 rated this helpful - Rate this topic

Exception Handling

CRM 1.2
banner art

The common exception that you receive from a request using this SDK is a SoapException. The message property of the SoapException is always "Server was unable to process request."

The Detail property of the SoapException will have more information about the exact error that occurred in the platform. The Detail property is an XmlNode and the InnerXml has the following format:

<error>
   <description>Error description goes here</description>
   <number>0xABCD1234</number>
   <type>Platform</type>
</error>

The number property is a HEX error code (similar to the error codes returned from 1.x SDK). For example, if the caller tries to retrieve a Fax that does not exist in the database, the error XML string is returned as follows:

<error>
   <description>Fax with Id = a2a9545d-a0c2-42b4-9708-a0b2badd77c8 does not exist</description>
   <number>0x80040217</number>
   <type>Platform</type>
</error>

Example

The following code shows an example of writing out the error information in a catch statement for debugging.

try 
{
   queues = service.RetrieveMultiple(query);
} 
catch(System.Web.Services.Protocols.SoapException ex)
{
   Console.WriteLine(ex.Message + "." + ex.Detail.InnerText);
}


© 2007 Microsoft Corporation. All rights reserved.


Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.