O'Reilly logo

Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications and Services by Len Fenster

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

5. The Exception Handling Application Block

I WAS ONCE BROUGHT into a company to help them diagnose an issue they were having with one of their applications that had already been deployed to production. The Web application was redirecting users to the home page for every request. It was causing users a great deal of pain and the company was losing a lot of business. Upon investigation, I observed that the code shown in Listing 5.1 was smattered throughout the application.

Listing 5.1. Bad Example of Exception Handling

        Try        ...        Catch ex As Exception             Response.Redirect("welcome.aspx")        End Try

Exceptions were being caught and “swallowed” by the application. There was no notification or record of the actual ...

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