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

Handling Custom Errors


You can create a custom set of error codes to handle errors that are specific to your code. 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.

Using the Body of the Code to Handle Custom Errors

Figure 4 includes an example that uses the body of the code to handle a custom error.

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

The example that uses the body of the code to handle a custom error includes the following items:

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

Using a Label to Handle Custom Errors

Figure 5 includes an example that uses a label to handle a custom error.

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

The example that uses a label to handle a custom error includes the following items:

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