switch クラス : ErrorMessages ゲッタ
説明
前回のハンドラの実行で発生したエラーメッセージのリストを返します。
構文
instance.ErrorMessages
引数
無し。
返り値
| クラス | 説明 |
| List{string} | 前回のハンドラの実行で発生したエラーメッセージのリスト。 |
サンプルコード
次のクラス定義があるとします。
| 1: | class handle |
| 2: | open method void LCHandler(dictionary dic) |
| 3: | throw "exception"; // Exception occurs. |
| 4: | endmethod |
| 5: | endclass |
ErrorMessages ゲッターの使い方は次のとおりです。
| 1: | browser b = new browser(); |
| 2: | message m; |
| 3: | handle h = new handle(); |
| 4: | switch sw = b.LoadCompleted(h,"LCHandler(dictionary)"); |
| 5: | sw.StopWithException = false; // Non-stop event handler. |
| 6: | sw.ShowException = false; // No error message dialog. |
| 7: | sw.Start(); // Start event handler. |
| 8: | _br.LoadUrl("https://example.com/", true); // It is synchronously page loading. |
| 9: | sleep slp. |
| 10: | slp.Freeze(10000); // It wait 10sec, the handler will be called and an exception will be thrown. |
| 11: | m.Show(sw.ErrorMessages); // It show error-messages. |
注意
前回のハンドラの実行中に発生した例外のうち、try文によってキャッチされなかった例外のエラーメッセージを返します。
全ての例外が try文によってキャッチされた場合、またはハンドラの実行が正常に完了した場合は、空の list{string} が返されます。
参照リンク
無し。


