Siebel VB Language Reference > Siebel VB Language Overview >

Error Handling in Siebel Visual Basic (VB)


Siebel VB contains three error handling statements and functions for trapping errors in your program: Err, Error, and On Error. Siebel VB returns a code for many of the possible run-time errors you might encounter. For a list of codes, read Trappable Errors in Siebel VB

In addition to the errors trapped by Siebel VB, you may want to create your own set of codes for trapping errors specific to your program. For example, create your own set of codes if your program establishes rules for file input and the user does not follow the rules. You can trigger an error and respond appropriately using the same statements and functions you would use for error codes returned by Siebel VB.

Regardless of the error trapped, you can use two methods to handle errors. You can put error-handling code directly before a line of code where an error might occur (such as after a File Open statement), or you can label a separate section of the procedure just for error handling, and force a jump to that label if any error occurs. The On Error statement handles both options.

For more information, read Trapping Errors Returned by Siebel Visual Basic (VB) and Trapping User-Defined, Non-Siebel VB Errors.

Siebel VB Language Reference Copyright © 2006, Oracle. All rights reserved.