try

try body ?handler ...? ?finally script?

Runs the body and then the first handler that matches its result. on CODE VARS SCRIPT matches a return code: ok, error, return, break, continue, or a number. trap PATTERN VARS SCRIPT matches an error whose error code starts with the list PATTERN. VARS names the variables for the result and the options. finally runs at the end in each case.

Examples

A click on an example runs it in the shell of the page.

Facts

Differences from Tcl 8.6