Siebel VB Language Reference > Using Siebel VB > About Error Handling >

Handling Custom Errors


To handle errors that are specific to your code, you can create a custom set of error codes. For example, you can create your own set of error codes if your Siebel VB code creates rules for file input but the user does not follow these rules. You can configure Siebel VB to create an error and reply appropriately using the same statements and functions that you use for error codes that Siebel VB returns.

Handling Custom Errors In the Body of the Code

Figure 4 includes an example that handles a custom error in the body of the code.

Figure 4. Example That Handles Custom Errors In the Body of the Code
Explanation of Callouts

The example that handles a custom error in the body of the code includes the following items:

  1. Place the code that handles the error immediately before the line of code that could cause an error.
  2. To set the custom error to a value of 30000, you use the Error statement.

Handling Custom Errors With a Label

Figure 5 includes an example that handles a custom error with a label.

Figure 5. Example That Handles Custom Errors With a Label
Explanation of Callouts

The example that handles a custom error with a label includes the following items:

  1. Place the code that handles the error immediately before the line of code that could cause an error.
  2. To handle the custom error, you use a labeled section of code.
Siebel VB Language Reference Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices.