If TypeOf Err.GetException() Is DHEException Then
This uses the keyword "TypeOf" and "Is" I have used it to make sure that the exceptions, catched though the bad "On Error" statement, is still handled and the correct error code is returned.
If Err.Number <> 0 Then
If TypeOf Err.GetException() Is DHEException Then
Dim ex As DHEException = Err.GetException
cerr = ex.dheErr
Else
cerr = -(1000000 + Err.Number)
End If
errMsg += "|ExecService:" + Err.Description + " " + Err.GetException.StackTrace
log.Error(errMsg)
End If
2 comments:
Bravo, brilliant idea
Ask, and it shall be given to you; seek, and you shall find it; knock, and it shall be opened unto you.
Post a Comment