M
marcmc
I cannot get my throw statement to run. The program hits
the 1 and 3 message boxes but not 2. I have included
Imports System.Exception
Imports Microsoft.VisualBasic
Private Sub btnLogError_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnLogError.Click
Dim at As New ErrorClassTest
Try
MessageBox.Show("1")
Throw New System.Exception("An error has
occurred")
MessageBox.Show("2")
Catch ex As Exception
MessageBox.Show("3")
If Not (at.LogError("\My Documents\Exception
Handler.log", _
ex.Message.ToString, _
"btnLogError_Click", _
"Testing Log File....")) Then
MessageBox.Show("Could not write to the
Log File", MessageBoxIcon.Exclamation)
End If
End Try
End Sub
the 1 and 3 message boxes but not 2. I have included
Imports System.Exception
Imports Microsoft.VisualBasic
Private Sub btnLogError_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnLogError.Click
Dim at As New ErrorClassTest
Try
MessageBox.Show("1")
Throw New System.Exception("An error has
occurred")
MessageBox.Show("2")
Catch ex As Exception
MessageBox.Show("3")
If Not (at.LogError("\My Documents\Exception
Handler.log", _
ex.Message.ToString, _
"btnLogError_Click", _
"Testing Log File....")) Then
MessageBox.Show("Could not write to the
Log File", MessageBoxIcon.Exclamation)
End If
End Try
End Sub