From: Arran Cudbard-Bell Date: Wed, 30 Apr 2025 18:28:19 +0000 (-0400) Subject: Update docs for timeout/catch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e970e46a343f3357285b52a49102b72a5cbb689;p=thirdparty%2Ffreeradius-server.git Update docs for timeout/catch Mostly removing evidence of its previous existence --- diff --git a/doc/antora/modules/reference/pages/unlang/catch.adoc b/doc/antora/modules/reference/pages/unlang/catch.adoc index bee5a5159e..26a71e65b6 100644 --- a/doc/antora/modules/reference/pages/unlang/catch.adoc +++ b/doc/antora/modules/reference/pages/unlang/catch.adoc @@ -11,17 +11,16 @@ catch [ rcodes ] { } ---- -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 diff --git a/doc/antora/modules/reference/pages/unlang/timeout.adoc b/doc/antora/modules/reference/pages/unlang/timeout.adoc index b98ecd50b8..e078754514 100644 --- a/doc/antora/modules/reference/pages/unlang/timeout.adoc +++ b/doc/antora/modules/reference/pages/unlang/timeout.adoc @@ -20,11 +20,6 @@ attribute reference. The contents of __ are interpreted as a 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] ---- @@ -44,16 +39,16 @@ called. .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