O'Reilly logo

Special Edition Using Microsoft® Visual Basic® .NET by Jeff Spotts, Brian Siler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing Code to Handle Exceptions

Users of your program are not likely to be developers or Visual Studio users. Therefore, to make your application more robust, you’ll want to add exception-handling code to control its behavior after an exception is thrown. Good exception-handling code should do the following:

  • Make sure the error is logged accurately, so you know which method call actually caused the exception.

  • Depending on the severity of the exception, you may want to display a message for the end user. This message should be written so that the user can understand it, and if necessary it should provide instructions on how to resolve the problem.

In a complex application, you may have objects that call other objects in a nested manner. It is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required