switch class : ShowException(bool) setter
Description
Sets a value that indicates whether to display the error messages.
Syntax
instance.ShowException = value;
Arguments
Class | Description |
bool | Whether to display the error messages. |
Return value
None
Sample code
Suppose you have the following class definition.
1: | class handle |
2: | open method void LCHandler(dictionary dic) |
3: | throw "exception"; // Exception occurs. |
4: | endmethod |
5: | endclass |
Usage of the ShowException setter is as follows.
1: | browser b = new browser(); |
2: | message m; |
3: | handle h = new handle(); |
4: | switch sw = b.LoadCompleted(h,"LCHandler(dictionary)"); |
5: | sw.ShowException = false; // No error message dialog. |
6: | sw.Start(); // Start event handler. |
7: | _br.LoadUrl("https://example.com/"); // Page loading. |
In the above code, the handler is called when the page load is complete.
An exception raises in the handler, but the error message dialog is not displayed.
Notes
Sets a value that indicates whether to display the error messages if an exception occurs in the handler.
Sets true if you want to display the error messages. Otherwise, sets false.
The defalut is true.
Links for reference
None