I set a global bug catcher in my application for unhandled exceptions and it is picking up all exceptions
- by user1632018
I am trying to figure out why this is happing. In my vb.net application I set a global handler in the ApplicationEvents.vb which I thought would only pick up any unhandled exceptions, although it is picking up every exception that happens in my application whether or not they are handled with try catch blocks. Here is my code in applicationevents
Private Sub MyApplication_UnhandledException(ByVal _
sender As Object, ByVal e As _
Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) _
Handles Me.UnhandledException
e.ExitApplication = _
MessageBox.Show(e.Exception.Message & _
vbCrLf & "The application has encountered a bug, would you like to Continue?", "An Error has occured.", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question) _
= DialogResult.No
End Sub
In the rest of my application I set normal try catch blocks like this:
Try
Catch ex as exception
End Try
Can anyone tell me why this is happening?