0 / 0
Throwing a ConnectorException class object (Java Integration stage)

Throwing a ConnectorException class object (Java Integration stage)

You can use the ConnectorException(com.ibm.is.cc.javastage.api.ConnectorException) class object from Processor implementation to stop a job that is running or to end a design-time operation with a message.

Use the ConnectorException class to log messages that do not include the stack trace information and also to assign message IDs to those messages.

In the following example, Java™ code constructs and throws a ConnectorException object after calling the Logger.setComponentID() method. The connector framework catches the exception, logs the error message An exception occurred. result=-1 and stops the job. The message ID is IIS-CONN-MYCONN-00999.

public class MyConnector extends Processor
{
   public MyConnector()
   {
     super();
     Logger.setComponentID(“MYCONN”);
   } 


   public void process() throws Exception
   {
      …
      if (result < 0)
      {
         throw new ConnectorException(999, " An exception occurred. result=" + result);
      }
   }
   …
}
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more