IVHooks interface : Error method

Error method
Event
An error occurred in VWorks software.
Description
VWorks software calls the Error method after an error occurs, that is, the plugin returned a RETURN_FAIL error code. See “ReturnCode enumerated type” .
Syntax
 
HRESULT Error(
[in] BSTR sXML,
[in, out] BSTR* sResultXML
);
Parameters
 
[in] An Error XML element containing information about the error that occurred in VWorks software.
Error method input
VWorks software passes an Error XML element into the sXML parameter of the Error method. This XML element provides information about the error that occurred in VWorks software.
Error element
The Error element has the following attributes:
 
If the protocol has been saved, the value of this attribute is the protocol’s file path. If the protocol has not been saved, the value is the default protocol name.
Example of Error method input
The following sample code is an Error XML element that is received by the plugin from VWorks software as a string in the sXML parameter of the Error method. VWorks software passes information about an error that was generated by the plugin named Plugin  1.
 
<Error Path='Protocol File - 1' Source='Plugin - 1' Message='Error'
InstanceNumber='1' DeviceName='Device - 1' LocationName='Location1'
Profile='Profile1' ProcessName='Process - 1' />
Error method output
The plugin returns a HookResults XML block in the sResultXML parameter of the Error method. For information about the structure and contents of this XML block, see “HookResults XML block” .
Example of Error method output
The following sample code is a HookResults XML block that is returned to VWorks software by the plugin as a string in the sResultXML parameter of the Error method. The plugin tells the scheduler to pause the runset. It also tells VWorks software to write the following Error-type message to the Main Log:
Unable to move to safe height at end of protocol.
 
version='1.0' >
<HookResults>
<Results>
<HookResult ResultType='Log Error' ResultValue='Unable to move to safe height
at end of protocol.' />
<HookResult ResultType='Pause Execution' ResultValue='True' />
</Results>
</HookResults>
Related information