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
unlangcommands which will be executed. Atryblock 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
}