Returns a list of the function calls that have caused an exception during the execution of the current test case.
lcFunctions = ExceptCalls ( )
| Return | Description |
|---|---|
| lcFunctions | The returned information. LIST OF CALL. |
ExceptCalls returns a list of records of type CALL, each of which corresponds to one function call. A CALL record has three fields, which are described in the following table:
| Field | Description |
|---|---|
| iLine | The line number in the script where the call or exception occurred. INTEGER. |
| sFunction | The name of the function in which the call or exception occurred. STRING. |
| sModule | The name of the file that contains sFunction. STRING. |
The list of CALL records begins with the most recent call and progresses sequentially backward from the function where the exception occurred.
[-] testcase ExceptCallsTest ()
[-] do
[ ] MyFunction ()
[-] except
[ ] PrintCallStack (ExceptCalls ())
[ ] MyFunction ()
[ ] Print ("In MyFunction")
[ ] raise 1, "raise an exception here"
[ ] PrintCallStack (LIST OF CALL lcCall)
[ ] CALL Call
[-] for each Call in lcCall
[ ] Print ("MODULE: {Call.sModule}", "FUNCTION: {Call.sFunction}", "LINE: {Call.iLine}")
[ ] // This script prints:
[ ] // In MyFunction
[ ] // MODULE: test.t FUNCTION: MyFunction LINE: 12
[ ] // MODULE: test.t FUNCTION: main LINE: 4