Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Handling Errors | BrokerExceptions | Catching Exceptions
 
Catching Exceptions
The example below shows how to catch an exception thrown by an webMethods Broker API method invocation. If an exception is thrown, this example code will print out the contents of the exception and return.
. . .
BrokerClient c;
. . .
/* Create a client */
try {
c = new BrokerClient(broker_host, broker_name, null,
client_group, "Publish Sample #1",null);
} catch (BrokerException ex) {
System.out.println("Error on create client\n"+ex);
return;
}
. . .