Siebel Object Interfaces Reference > Customizing Siebel Object Interfaces >

Configuring Error Handling


This topic describes how to configure error handling.

COM Error Handling

The errCode parameter is the last parameter for every COM Data Server interface method. It is not available in the following object interfaces:

  • COM Data Control
  • Mobile Web Client Automation Server
  • Web Client Automation Server
  • Siebel Java Data Bean

Examples of Configuring Error Handling

This topic includes examples of configuring error handling.

Example of Configuring Error Handling for the COM Data Server

The following code is an example of error handling only for the COM Data Server:

GetBusObject (BusObjectName as string, errcode as integer) -> businessObject

Example of Configuring Error Handling for COM Data Control and Mobile Web Client Automation Server

The following code is an example of error handling for COM Data Control and Mobile Web Client Automation Server:

GetBusObject (BusObjectName as string) -> businessObject

Example of Configuring Error Handling for Siebel Java Data Bean

The SiebelException object handles errors in Siebel Java Data Bean. You can use the getErrorCode method and getErrorMessage method with the SiebelException object. The SiebelException object is defined in the com.siebel.data.SiebelException file. This file is a class file in one of the.jar files included in any java project that must communicate with Siebel CRM. For example:

...

import com.siebel.data.SiebelException;
import com.siebel.data.SiebelDataBean;
...
SiebelDataBean mySiebelBean=null;
try

{
   mySiebelBean = new SiebelDataBean();
   mySiebelBean.login("Siebel://SOMSERVER/somsiebel/AppObjMgr/", "CCONWAY", "CCONWAY","enu");
}
catch (SiebelException e){
   // Exception handling code
   System.out.println (e.getErrorMessage ());
mySiebelBean = null; //avoid using mySiebelBean if login is unsuccessful
}

...

The ellipsis (...) in this code indicates code that was removed from the example in this book for brevity.

For more object interface methods on the SiebelException object, see the Siebel Java Data Bean JavaDoc that Oracle Universal Installer installs when you install Siebel Tools. Note that Oracle Universal Installer installs the JavaDoc only if you install the Siebel Java Integration option. It installs a zipped file that contains the JavaDoc in the Tools_ROOT\CLASSES folder.

Error Message Tracking

For error message tracking in ActiveX, you can use exceptions or object interface methods. This topic describes the methods that you can use.

EnableExceptions Method

The EnableExceptions method allows Siebel CRM to use native COM error handling. If the method is about to fail due to error, then Siebel CRM creates a COM exception and does not return the method. The COM host receives the control instead. Siebel CRM might display the error message, which is the default behavior for Microsoft Internet Explorer or Siebel VB. You cannot use script to modify this behavior.

The following code is an example of using the EnableExceptions method:

EnableExceptions(enable as integer)

GetLastErrCode Method and GetLastErrText Method

After Siebel CRM runs an object interface method, you can do the following:

  • To determine if Siebel CRM returned an error from the previous operation, you can call the GetLastErrCode method.
  • To return the text of the error message, you can call the GetLastErrText method.

For example:

GetLastErrCode() ' returns errCode As Integer

GetLastErrText() ' returns text As String

Siebel Object Interfaces Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.