timer class : ErrorMessages getter

Description

Returns a list of error messages that occurred in the previous execution of the handler.

Syntax

instance.ErrorMessages

Arguments

None

Return value

ClassDescription
List{string}A list of error messages that occurred in the previous execution of the handler.

Sample code

Suppose you have the following class definition.

1:

class handle

2:

open method void THandler(dictionary dic)

3:

throw "exception"; // Exception occurs.

4:

endmethod

5:

endclass

Usage of the ErrorMessages getter is as follows.

1:

handle h = new handle();

2:

timer tim = new timer(h, "THandler(dictionary)", 1000);

3:

tim.StopWithException = false; // Non-stop timer handler.

4:

tim.ShowException = false; // No error message dialog.

5:

tim.OneShot(); // Start timer handler just once.

6:

sleep slp.

7:

slp.Freeze(10000); // It wait 10sec, the handler will be called and an exception will be thrown.

8:

message m;

9:

m.Show(tim.ErrorMessages); // It show error-messages.

Notes

Returns a list of error messages of the exception that was not caught by a try statement among the exceptions that occurred during the previous execution of the handler.

The empty list is returned if all of the exception is caught by the try statement or the handler execution is successfully completed.

Links for reference

None.

Copyright © Cooker All rights reserved.