Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

<catchall>

<catch> に合致しないフォールトやシステム・エラーをキャッチします。

Synopsis

<scope>   <throw fault='"MyFault"'/>         ...   <faulthandlers>     <catch fault='"MyFault"'>           ...     </catch>     <catch fault='"OtherFault"'>           ...     </catch>     <catchall>           ...     </catchall>   </faulthandlers> </scope>

詳細

属性または要素 説明
namedisabledxposyposxendyend 属性 一般的な属性と要素” を参照してください。
<annotation> 要素
その他の要素 オプション。<catchall> には、<alert>、<assign>、<branch>、<break>、<call>、<code>、<compensate>、<continue>、<delay>、<empty>、<foreach>、<if>、<label>、<milestone>、<reply>、<rule>、<scope>、<sequence>、<sql>、<switch>、<sync>、<throw>、<trace>、<transform>、<until>、<while>、<xpath> および <xslt> をゼロ個以上、自由に組み合わせて使用できます。

説明

<throw> 文が実行されると、同じ <scope> 内にある <faulthandlers> ブロックに即座に制御が移り、<throw> 以降の途中の文はすべてスキップされます。次にプログラムは、<faulthandlers> ブロック内で、<throw> 文の fault 文字列式と value 属性が同じである <catch> ブロックを探します。見つかった場合は、この <catch> ブロック内のコードが実行され、その後で <scope> から抜けます。終わりの </scope> 要素の次の文から実行を再開します。

フォールトが発生し、フォールト文字列に一致する <catch> ブロックが <faulthandlers> ブロック内に存在しない場合は、<throw> 文から、<faulthandlers> 内の <catchall> ブロックに制御が移ります。<catchall> ブロック内のコードを実行した後で、<scope> から抜けます。終わりの </scope> 要素の次の文から実行を再開します。予期しないエラーを確実にキャッチするため、すべての <faulthandlers> ブロック内に <catchall> ブロックを配置することをお勧めします。

詳細は、"BPL プロセスの開発" の “BPL エラー処理規則” を参照してください。

Note:

<catchall> を設ける場合は、それを <faulthandlers> ブロックの最後の文にする必要があります。必ず、<catchall> の前にすべての <catch> ブロックを配置します。

関連項目

<catch><compensate><compensationhandlers><faulthandlers><scope><throw>

FeedbackOpens in a new tab