Chapter 21. Avoiding Crashes by Handling Exceptions

In This Chapter

  • Using the language of exceptions

  • Creating a better error page

  • Sending error alerts by e-mail

  • Trying and catching exceptions

  • Fixing some common exceptions

If anything can go wrong, it will. Despite your best efforts to keep bugs out of your code and account for all eventualities, Murphy's Law applies fully to computer programs. A hidden flaw never stays hidden for long. Code that was working fine for months suddenly acts up. Everyone involved swears nothing changed. Obviously, something changed — it's just that nobody knows what it was. Sometimes you never find out because the problem mysteriously resolves itself. You eventually dismiss it as a "computer thing" and forget it.

In Chapter 20, you use the VWD debugger and tracing features to root out annoying bugs. In this chapter, you try to cope with the unforeseen and limit the damage when the unforeseen inevitably happens. Remember: Nature always sides with the hidden flaw!

Get ASP.NET 3.5 For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.