}
----
-The `catch` statement runs a series of substatements in a block, but only if the previous xref:unlang/try.adoc[try] failed.
+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`, or `reject`.
+[ rcodes ]:: Zero or more module return codes. The return codes can be `disallow`, `fail`, `invalid`, `timeout`, or `reject`.
+
-If the `catch` statement is after a xref:unlang/timeout.adoc[timeout] statement, then the `catch` will run only if the `timeout` section fails. In this case, you must use `catch timeout { ... }`. The `catch timeout` syntax is not allowed in any other situation.
[ 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.
-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
.Example
The time scale can be changed by appending `s`, `us`, `ms`, `ns`, etc. as
with all uses of `time_delta` values.
-As a special case, a `timeout` section can be immediately followed by
-a xref:unlang/catch.adoc[catch] statement, as `catch timeout { ... }`.
-In that case, the xref:unlang/catch.adoc[catch] section is run when
-the `timeout` expires.
-
.Example
[source,unlang]
----
.Example using catch
[source,unlang]
----
-timeout 4s {
- sql
+try {
+ timeout 4s {
+ sql
+ }
}
catch timeout {
detail
}
----
-
-
== Timeout with redundant
The `timeout` can also be used inside of a