$::errorCode contains error information in various cases (see the man page above); one of these cases is the exit status of the last exec or open "|..."/close pair that received an error.
See also tclvars, error, and return.
Anyone have good programming practices for using this? (The exec page gives a start at handling $::errorCode for [exec] or [open "|..."].)
[ Tcl syntax help | Category Debugging ]