Home Cooker Classes Others Rice
Classes  >  switch  >  ErrorMessages
switch class : ErrorMessages getter

Description

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

Syntax

switchInstance.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 handler(lceva ea)

8:

// any handling code....

9:

endmethod

10:

...

11:

endclass

Usage of the ErrorMessages getter is as follows.

1:

browser b = new browser();

2:

message m;

3:

handle h = new handle();

4:

switch ehs = b.LoadCompleted(h,"handler(lceva)");

5:

ehs.Start(); // Starts handling.

6:

...

7:

// The page loading failed.

8:

...

9:

if(ehs.IsError)

10:

list{string} errormessages = ehs.ErrorMessages;

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 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 © Rice All rights reserved.