Home Notices Documents Classes Download Others Rice
Classes  >  timer  >  ErrorMessages
timer class : ErrorMessages getter

Description

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

Syntax

timerInstance.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:

...

3:

open fitter handle()

4:

// any initialization code...

5:

endfitter

6:

...

7:

open method void timerHandler(timer t)

8:

// any handling code....

9:

endmethod

10:

...

11:

endclass

Usage of the ErrorMessages getter is as follows.

1:

handle h = new handle();

2:

timer t = new timer(h,"timerHandler(timer)", 1000); // The interval is 1000 milliseconds.

3:

t.StopWithException = true; // This timer will stop if exception occur.

4:

t.Start(); // Starts handling.

5:

...

6:

// An exception occurs in the timer handler.

7:

...

8:

if(t.IsError)

9:

list{string} errormessages = t.ErrorMessages;

10:

message m;

11:

m.Show(errormessages);

12:

endif

Notes

Gets a list of error messages of the exception that was not caught by a try statement among the exception 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 © Rice All rights reserved.