Control Structures
These are examples of control structures. You may also be interested in:

 Conditional structures
 Exceptions
 Flow-control structures
 Loops

This task is to give an example of an exception handling routine
and to "throw" a new exception.



Related task

   Exceptions Through Nested Calls


package require Tcl 8.5
 
# Throw
proc e {args} {
    error "error message" "error message for stack trace" {errorCode list}
}
 
# Catch and rethrow
proc f {} {
    if {[catch {e 1 2 3 4} errMsg options] != 0} {
        return -options $options $errMsg 
    }
}
 
f