Effective Error Handling

Effective Error Handling

While working with classes in VB 4.0, we found that the errors raised from our classes were not being trapped at the form level. We used “On Error Resume Next,” but still the error was being raised in the class module. We changed the settings of the Advanced Tab from Options in the Tools menu to “Break Unhandled Error,” and it worked as we needed.So, if you want to raise an error from a class module in your application to the form, you must use the Err.Raise method to raise the error. The error will be handled in the form only if you set the option from Options in the Tools menu in the Advanced Tab to “Break On Unhandled Error.” Otherwise, the error is raised in the class itself because the default setting is “Break On Class Module.”

See also  Monetize TikTok For Your Business

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist