How To Create a Generic Error Handler for your Application (191474)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q191474 SUMMARY
The Visual Basic ON ERROR statement is designed to encapsulate error
handling for each procedure or module in an application. This behavior is
by design, and is intended to conform with object oriented programming
(OOP) conventions. When you create an application, you may wish to have a
generic error handler that traps all errors for the application, and handle
exceptions to this routine as they occur in various modules.
The ON ERROR statement does not allow the use of an application wide ON
ERROR routine. However, it is possible to create a generic routine that is
called from within each procedure or method in the application.
REFERENCES
Visual Basic 5.0 Books Online - Error Handling
Visual Basic 6.0 MSDN - Error Handling
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbhowto KB191474 |
---|
|