1) The TOnError object can handle only TestPartner errors (like attach error, error while trying to select a non existing item in a combobox, etc.) but does not see VB or system errors like division by zero.
2) The VB command On Error Go To may allow you to handle all errors. But, if an error occurs within an object method, you cannot handle it in the script that calls this method. This impossibility is due to a bug in TestPartner (see the long discussion "TP, VB Classes, and Error"), a bug that was resolved some two or three years ago but was reintroduced in the newer versions of TestPartner. In VB it is possible to write:
On Error Go To MyErrorHandler
a = myObject.MyObjectFunction("hello")
and the execution jumps to MyErrorHandler if an error occurs within MyObjectFunction (you have to choose "Break on Unhandled Errors" in the VB options to activate this behaviour). Due to the bug in TestPartner, you have to handle the error within MyObjectFunction and pass somehow the information back to the calling script (see again "TP, VB Classes, and Error").
I think that it is time to reopen the bug report with Compuware.
Function SetValue(ByVal Value As String)
Dim oe As TOnError
Set oe = OnError("EditBoxError")
On Error Resume Next
[ QUOTE ]
<font color="blue">if Err then
end IF </font>
[/ QUOTE ]
Function EditBoxError() As tpOnErrorType
EditBxError = tpRetry
<font color="red">Note:</font> "Err" has properties which you can use such as
[ QUOTE ]
If Err.number='-282938346494' Then
Do what ever