User Friendly ASP.NET Exception Handling

I just posted a new article to CodeProject, User Friendly ASP.NET Exception Handling.

This is a companion discussion topic for the original blog entry at:

I added code for custom errors support in web.config.
Please check it. If you like,please add to your code project article.

Protected Overridable Sub OnError(ByVal sender As Object, ByVal args As EventArgs)
Dim app As HttpApplication = CType(sender, HttpApplication)
If InStr(app.Server.GetLastError.Message, “The file”) 0 And InStr(app.Server.GetLastError.Message, “does not exist”) 0 Then
Dim ueh As New Handler

  Dim virtualPath As String = Sahin.Diagnostics.Errorlog.Config.GetString("AppPath")
  Dim config As Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(virtualPath)

  Dim cusErr As Web.Configuration.CustomErrorsSection
  cusErr = CType(config.SectionGroups("system.web").Sections("customErrors"), Web.Configuration.CustomErrorsSection)
  If cusErr.Mode = Web.Configuration.CustomErrorsMode.On Then
    For Each err As System.Web.Configuration.CustomError In cusErr.Errors
      If err.StatusCode = 404 Then
      End If
  End If
  Dim ueh As New Handler
End If

End Sub