try {
...
}
-catch [ rcodes ] {
+catch [ <return-codes> ] {
[ statements ]
}
----
The `catch` statement runs a series of substatements in a block, but only if the previous xref:unlang/try.adoc[try] failed.
-[ rcodes ]:: Zero or more module return codes. The return codes can be `disallow`, `fail`, `invalid`, `timeout`, or `reject`.
-+
+<return codes>:: Zero or more xref:unlang/condition/return_codes.adoc[return codes].
[ statements ]:: The `unlang` commands which will be executed. A `catch` block can be empty.
-If no rcode is given the `catch` statement matches all of the codes listed above. Otherwise, the `catch` statement matches one of the listed rcodes.
+If no return code is given, then the `catch` statement will match all of the return codes. Otherwise, the `catch` statement matches only the return codes which were listed.
-Multiple `catch` statements can be placed one after the other, to `catch` different errors. Only one of the statements will be executed. Once a `catch` statement is finished, the interpreter will skip all trailing `catch` statements, and continue execution
+Multiple `catch` statements can be placed one after the other, to `catch` different errors. Only one of the statements will be executed. Once a `catch` statement is finished, the interpreter will skip all trailing `catch` statements, and continue execution with the next statement.
.Example