In my serverside HandleData i've tried to set up an error handling system. For every packet being recieved it sets CurrRunning to the packet name. Now what i want is for when it finds an error, to write it in the log. I'm not sure exactly how OnError works, just OnError Resume Next, but i'm sure someone can help me.
If running the the code after the error doesnt matter, make a label at the end of the sub e.g 'ErrorHandler:' ' HandleError:' then put 'OnError GoTo ErrorHandler' or what ever you called the lebel
Btw, make sure you put exit sub or exit function before the lebel, otherwise if the code allows, it will run the error handler no matter what
grimsk8ter11
Unregistered
Code:
Sub HandleData(Index As Long, Data As String)
On Error GoTo Hell
codecodecodecode
Exit Sub 'stupid mis
Hell:
log code
End Sub
visual representation of what funky said.
Or soemthing like this:
Code:
Sub HandleData(Index As Long, Data As String)
On Error Resume Next
code code code code
If Err.Number 0 Then 'can also amke thsi so it does specific things for each error.
log code
Err.Clear
End If
End Sub
that will continue through the code and post the error at the end, incase things still need to be ran further on.
Misunderstood
Unregistered
Quote:Sub Handledata
On error got Hell
......
exit sub
Hell:
Call errorHandler(err)
End sub
Also keep in mind, On Error GoTo 0, is useful for stopping all error handling routines in the current procedure.