If I have something like below, and I catch an error in DoWork, how do
I then get e.Error in RunWorkerComple ted to populate ?
Private Sub bg_DoWork(ByVal sender As Object, ByVal e As
System.Componen tModel.DoWorkEv entArgs) Handles _downloadWorker .DoWork
Try
e.Result = SomeLongRunning Task
Catch ex As Exception
e.Result = ex
End Try
End Sub
Private Sub bg_RunWorkerCom pleted(ByVal sender As Object, ByVal e
As System.Componen tModel.RunWorke rCompletedEvent Args) Handles
_downloadWorker .RunWorkerCompl eted
If e.Error IsNot Nothing Then
MsgBox(e.Error. Message)
Else
If e.Cancelled Then
MsgBox("Cancell ed")
Else
MsgBox("Done")
End If
End If
End Sub
I then get e.Error in RunWorkerComple ted to populate ?
Private Sub bg_DoWork(ByVal sender As Object, ByVal e As
System.Componen tModel.DoWorkEv entArgs) Handles _downloadWorker .DoWork
Try
e.Result = SomeLongRunning Task
Catch ex As Exception
e.Result = ex
End Try
End Sub
Private Sub bg_RunWorkerCom pleted(ByVal sender As Object, ByVal e
As System.Componen tModel.RunWorke rCompletedEvent Args) Handles
_downloadWorker .RunWorkerCompl eted
If e.Error IsNot Nothing Then
MsgBox(e.Error. Message)
Else
If e.Cancelled Then
MsgBox("Cancell ed")
Else
MsgBox("Done")
End If
End If
End Sub
Comment