If you want to customize your error processing, you will probably want to write your own error-handling function, which you can reuse in many scripts.
testcase VerifyTest () STRING sTestValue = "xxx" STRING sExpectedValue = "yyy" CompValues (sExpectedValue, sTestValue) CompValues (STRING sExpectedValue, STRING sTestValue) do Verify (sExpectedValue, sTestValue) except ErrorHandler () ErrorHandler () CALL Call LIST OF CALL lCall lCall = ExceptCalls () Print (ExceptData ()) for each Call in lCall Print("Module: {Call.sModule}", "Function: {Call.sFunction}", "Line: {Call.iLine}")
Silk Test Classic also provides the function ExceptPrint, which combines the features of ExceptCalls, ExceptData, and ExceptNum.
Testcase VerifyTest - Passed *** Error: Verify value failed - got "yyy", expected "xxx" Module: Function: Verify Line: 0 Module: except.t Function: CompValues Line: 121 Module: except.t Function: VerifyTest Line: 112
The second line is the result of printing the information from ExceptData. The rest of the lines show the processing of the information from ExceptCalls.
This test case passes because the error was handled locally and not re-raised.