1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1992-1994 The Regents of the University of California.
|
3 |
|
|
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
4 |
|
|
'\"
|
5 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
6 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
7 |
|
|
'\"
|
8 |
|
|
'\" RCS: @(#) $Id: BackgdErr.3,v 1.1.1.1 2002-01-16 10:25:23 markom Exp $
|
9 |
|
|
'\"
|
10 |
|
|
.so man.macros
|
11 |
|
|
.TH Tcl_BackgroundError 3 7.5 Tcl "Tcl Library Procedures"
|
12 |
|
|
.BS
|
13 |
|
|
.SH NAME
|
14 |
|
|
Tcl_BackgroundError \- report Tcl error that occurred in background processing
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
.nf
|
17 |
|
|
\fB#include \fR
|
18 |
|
|
.sp
|
19 |
|
|
\fBTcl_BackgroundError\fR(\fIinterp\fR)
|
20 |
|
|
.SH ARGUMENTS
|
21 |
|
|
.AS Tcl_Interp *interp
|
22 |
|
|
.AP Tcl_Interp *interp in
|
23 |
|
|
Interpreter in which the error occurred.
|
24 |
|
|
.BE
|
25 |
|
|
|
26 |
|
|
.SH DESCRIPTION
|
27 |
|
|
.PP
|
28 |
|
|
This procedure is typically invoked when a Tcl error occurs during
|
29 |
|
|
``background processing'' such as executing an event handler.
|
30 |
|
|
When such an error occurs, the error condition is reported to Tcl
|
31 |
|
|
or to a widget or some other C code, and there is not usually any
|
32 |
|
|
obvious way for that code to report the error to the user.
|
33 |
|
|
In these cases the code calls \fBTcl_BackgroundError\fR with an
|
34 |
|
|
\fIinterp\fR argument identifying the interpreter in which the
|
35 |
|
|
error occurred. At the time \fBTcl_BackgroundError\fR is invoked,
|
36 |
|
|
\fIinterp->result\fR is expected to contain an error message.
|
37 |
|
|
\fBTcl_BackgroundError\fR will invoke the \fBbgerror\fR
|
38 |
|
|
Tcl command to report the error in an application-specific fashion.
|
39 |
|
|
If no \fBbgerror\fR command exists, or if it returns with an error condition,
|
40 |
|
|
then \fBTcl_BackgroundError\fR reports the error itself by printing
|
41 |
|
|
a message on the standard error file.
|
42 |
|
|
.PP
|
43 |
|
|
\fBTcl_BackgroundError\fR does not invoke \fBbgerror\fR immediately
|
44 |
|
|
because this could potentially interfere with scripts that are in process
|
45 |
|
|
at the time the error occurred.
|
46 |
|
|
Instead, it invokes \fBbgerror\fR later as an idle callback.
|
47 |
|
|
\fBTcl_BackgroundError\fR saves the values of the \fBerrorInfo\fR and
|
48 |
|
|
\fBerrorCode\fR variables and restores these values just before
|
49 |
|
|
invoking \fBbgerror\fR.
|
50 |
|
|
.PP
|
51 |
|
|
It is possible for many background errors to accumulate before
|
52 |
|
|
\fBbgerror\fR is invoked. When this happens, each of the errors
|
53 |
|
|
is processed in order. However, if \fBbgerror\fR returns a
|
54 |
|
|
break exception, then all remaining error reports for the
|
55 |
|
|
interpreter are skipped.
|
56 |
|
|
|
57 |
|
|
.SH KEYWORDS
|
58 |
|
|
background, bgerror, error
|