FreeRADIUS InkBridge

The try Statement

Syntax
try {
    [ statements ]
}
catch [ <return-codes> ] {
    ...
}
catch [ <return-codes> ] {
    ...
}

The try statement runs a series of substatements in a block. If the block returns an error such as fail, reject, invalid, disallow, or timeout, a subsequent catch block is executed.

[ statements ]

The unlang commands which will be executed. A try block cannot be empty.

Every try block must be followed by at least one catch block.

Example
try {
	sql
}
catch fail {
	# ... run only if sql failed

	ok	# over-ride the "fail" code
}

There is some overlap in functionality between try / catch and redundant. See the catch documentation for more details.