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.