backgdErr(3)

CLASS
tcl.lang.Interp -- This manual entry contains Interp methods that report Tcl background errors.

METHODS

void backgroundError()

void addErrorInfo(String message)

void setErrorCode(TclObject code)

OTHER METHODS
setVar, traceVar, createCommand, eval, setResult,
getNotifier, setAssocData, dispose, pkgRequire

ARGUMENTS
Message to appear in global errorInfo Tcl variable. TclObject to become value of global errorCode Tcl variable.

DESCRIPTION
The procedures described here are utilities for reporting Tcl errors that occurred in background processing. See the manual entry setResult for information on storing result values.

backgroundError
    The backgroundError method is typically invoked when a Tcl error occurs during "background processing" such as executing an event handler. When backgroundError() is called, it saves the current result, errorCode and errorInfo and will invoke the "bgerror" command at a later time as an idle callback. If no bgerror command exists, or if the bgerror command returns with an error condition, then backgroundError() reports the error itself by printing a message on the standard error output. It is possible for many background errors to accumulate before bgerror is invoked. When this happens, each of the errors is processed in order. However, if bgerror returns a break exception, then all remaining error reports for the interpreter are skipped.

addErrorInfo
    The addErrorInfo method appends message to the errorInfo object in the interpreter. The errorInfo object is mirrored in Tcl scripts via the "errorInfo" global variable.

setErrorCode
    The setErrorCode method sets the interpreter's errorCode object to the value of code. The errorCode object is mirrored in Tcl scripts via the "errorCode" global variable.

EQUIVALENT C FUNCTIONS
Tcl_BackgroundError, Tcl_AddErrorInfo, Tcl_SetObjErrorCode

SEE ALSO
Interp, TclException, TclRuntimeError, TclEvent, dispose, setAssocData

KEYWORDS
background, bgerror, error, interpreter