'\" '\" Copyright 1990 Regents of the University of California '\" Permission to use, copy, modify, and distribute this '\" documentation for any purpose and without fee is hereby '\" granted, provided that this notice appears in all copies. '\" The University of California makes no representations about '\" the suitability of this material for any purpose. It is '\" provided "as is" without express or implied warranty. '\" '\" $Header: /a/cvs/386BSD/ports/tk/doc/tkerror.n,v 1.1.1.1 1993/08/09 01:21:07 jkh Exp $ SPRITE (Berkeley) '/" .so man.macros .HS tkerror cmds .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tkerror \- Command invoked to process background errors .SH SYNOPSIS \fBtkerror \fImessage\fR .BE .SH DESCRIPTION .PP The \fBtkerror\fR command doesn't exist as part of Tk. Instead, individual applications or users can define a \fBtkerror\fR command (e.g. as a Tcl procedure) if they wish to handle background errors. .PP A background error is one that occurs in a command that didn't originate with the application. For example, if an error occurs while executing a command specified with a \fBbind\fR of \fBafter\fR command, then it is a background error. For a non-background error, the error can simply be returned up through nested Tcl command evaluations until it reaches the top-level code in the application; then the application can report the error in whatever way it wishes. When a background error occurs, the unwinding ends in the Tk library and there is no obvious way for Tk to report the error. .PP When Tk detects a background error, it invokes the \fBtkerror\fR command, passing it the error message as its only argument. Tk assumes that the application has implemented the \fBtkerror\fR command, and that the command will report the error in a way that makes sense for the application. Tk will ignore any result returned by the \fBtkerror\fR command. .PP If another Tcl error occurs within the \fBtkerror\fR command (e.g. because the application hasn't defined a \fBtkerror\fR command), then Tk reports the error itself by writing a message to stderr. .SH KEYWORDS background error, reporting