: '''[interp] bgerror''' ''path'' ?''cmdPrefix''? From http://www.tcl.tk/man/tcl8.5/TclCmd/interp.htm: When an error happens in a situation where it cannot be reported directly up the stack (e.g. when processing events in an [update] or [vwait] call) the error is instead reported through the background error handling mechanism. Every interpreter has a background error handler registered; the default error handler arranges for the [bgerror] command in the interpreter's global namespace to be called, but other error handlers may be installed and process background errors in substantially different ways. A background error handler consists of a non-empty list of words to which will be appended two further words at invocation time. The first word will be the error message string, and the second will a dictionary of return options (this is also the sort of information that can be obtained by trapping a normal error using [catch] of course.) The resulting list will then be executed in the interpreter's global namespace without further substitutions being performed. <> MAKR 2007-11-26: There is no further hint at the [interp] page currently. I am interested in examples how this is supposed to be used. Especially as the [bgerror] man page encourages the move to this type of usage. <> <> Call bg error handler manually [HaO] 2012-09-05: I want to invoke the background handler by a program to inform about an error. The only way I found was: ====== if {1 == [catch { eval $cmd } e errdict]} { catch {eval [interp bgerror ""] [list $e $errdict]} } ====== I am not shure, if the eval if necessary or if it should better be put into an after call... <> <> Command | Tcl syntax help