1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 9 - Structured Error Handling

By Dan Mabbutt, About.com

1 of 10

Structure FINALLY comes to VB Error Handling!

Structured Error Handling

Structured Error Handling

If the old coder's saying is true: "Good programmers write good code but great programmers steal great code." ... then Microsoft has done a really 'great' job in adding a new way to handle runtime errors in VB.NET! That is, it's new to VB.NET. The whole idea was pioneered and perfected in languages like C++ and Java. VB.NET has taken the 'best of the best' and made it part of the language. And it works.

Chapter 9 shows you the new, old way to do the job right!

Like real estate, there are three things that are most important about coding structured error handling in VB.NET.

  1. Location
  2. Location
  3. Location

In other words, the first thing to think about is where to put the error trapping in your code. Once you decide that, then you write the error handling code to intercept the errors and minimize the effect of bad things happening in your program. Where are those critical locations? Look for the situations listed in the table at the bottom of page 227. The rest of Chapter 9 tells you how to actually write the error handling code.

If you're interested in the official Microsoft "tutorial" on this topic, you can find it at the MSDN site here.

Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Trapping Errors Using Structured Error Handling

©2009 About.com, a part of The New York Times Company.

All rights reserved.