Debugging Runtime Error and Performance Analysis

To handle occurrences of exceptions and special conditions that change the normal flow of the program execution, error handling has to be done appropriately.

The following code illustrates how to handle errors for asynchronous requests.
public void onError(ISDMRequest aRequest, IHttpResponse aResponse, ISDMRequestStateElement aRequestStateElement))
{
int errCode = aRequestStateElement.getErrorCode();
String str = new String(aResponse.getContent());
serviceDocument = "Error Code: "+ errCode + str;
}