Handling Exceptions 
You create an exception in the service component, include it in your custom operation, and define its function by adding the Java code that throws the exception. You can also create an exception message. Each time an exception occurs, this message is displayed on the mobile device. For more information on messages, refer to Programming User Messages.
You have created:
A Mobile Service Component
More information: Creating a Mobile Service Component
A custom operation, to which you want to add one or more exceptions
More information: Creating a Custom Operation
In the Service Explorer, select the Exceptions node under your service component.
From the context menu, choose Create Exception.
In the Create Exception dialog box, enter an Exception Name.
Enter a Description (recommended).
Repeat the steps above to create additional exceptions.
Open the Custom Operation Designer for your custom operation.
Select the Exceptions from the drop-down list.
Alternatively, you can drag the exceptions into the Exceptions field from the data tree.
Repeat the steps above to include additional exceptions.
Select your service under the Services node containing your operation.
In the context menu of the service, choose .
Alternatively, you can choose and then choose the <service>.java tab page.
In the Java Editor, enter the appropriate code for your exception under the appropriate method.
You can now implement the operation's implementations between the tags //@@begin implementation and //@@end. The generation ensures that any code between those tags is always preserved, even if the operation's signature is changed.