R
Rexel
Implementing VB's stock error handler, "On Error Goto Err_Label", is
easy enough using Try/Catch/Finally.
I also figured out how to implement "On Error Resume Next" case, like
when you want to delete a file but don't care about the error if the file
doesn't exists.
So:
Try
'main code
Try
'line causing error
Catch
End Try
'continue main code
Catch
'main error handler
Finally
'cleanup if needed
End Try
The simple Try/Catch block in the middle will do the same as
"On Error Resume Next".
But I haven't been able to implement "On Error Resume", where I
want to try again the line of code that caused the error.
It seems that you have to set up a loop enclosing the Try/Catch block.
How do the experts implement "On Error Resume" case in VB.NET?
easy enough using Try/Catch/Finally.
I also figured out how to implement "On Error Resume Next" case, like
when you want to delete a file but don't care about the error if the file
doesn't exists.
So:
Try
'main code
Try
'line causing error
Catch
End Try
'continue main code
Catch
'main error handler
Finally
'cleanup if needed
End Try
The simple Try/Catch block in the middle will do the same as
"On Error Resume Next".
But I haven't been able to implement "On Error Resume", where I
want to try again the line of code that caused the error.
It seems that you have to set up a loop enclosing the Try/Catch block.
How do the experts implement "On Error Resume" case in VB.NET?