focal (3) bgerror.3tcl.gz

Provided by: manpages-zh_1.6.3.3-2_all bug

NAME

       bgerror - 为处理后台错误而被调用的命令

总览 SYNOPSIS

       bgerror message
_________________________________________________________________

描述 DESCRIPTION

       bgerror  命令不作为 Tcl 内置部分而存在。如果单独的某个应用或用户希望处理后台错误,可以定义一个 bgerror 命
       令(例如,作为一个 Tcl 过程)。

       后台错误发生在事件处理器(handler)或不是由应用发起(originate)的一些其他命令中。例如,如果在执行一个用
       after 命令指定的一个命令时发生了一个错误,那么这就是一个后台错误。对于一个非后台错误,通过嵌套的 Tcl 命令
       求值(evaluation), 错误可以被简单的向上返回,直到到达应用中的顶层代码;则应用可以用任何它希望的方式来报告
       错误。  当一个后台错误发生时,在 Tcl 库中终止命令解释(unwinding ends ? 松开末端)并且没有给 Tcl 用来报告错
       误明显的途径。

       当 Tcl  检测到一个后台错误时,它保存关于错误的信息并作为一个空闲处理器而在以后调用  bgerror  命令。在调用
       bgerror  之前,Tcl 把 fBerrorInfo 和 errorCode 变量的存储成它们在错误发生时的值,接着用错误消息作为唯一的
       参数来调用 bgerror。Tcl  假定应用已经实现了  bgerror  命令,命令以对应用有意义的方式来报告错误。  Tcl  在
       bgerror 命令没有生成错误时忽略返回的任何结果。

       如果在  bgerror 命令中发生了另一个 Tcl 错误(例如,没有定义 bgerror 命令)则 Tcl 通过向标准错误写消息来处理
       这个自身的错误。

       在调用  bgerror  来处理错误之前如果积累了一些错误,将以发生的次序为每个错误调用一次   bgerror。但是,如果
       bgerror 以一个 break 例外返回,则跳过所有的余下的错误而不调用 bgerror。

        Tcl  没有缺省的实现  bgerror。但是,在使用   Tk  的应用中有一个缺省的 bgerror 过程,它贴出(post)一个对话
       框,包含了错误信息并向用户提供一个机会来查看显示在什么地方发生错误的栈跟踪。 In addition to allowing  the
       user to view the stack trace, the dialog provides an additional application configurable button which may
       be used, for example, to save the stack trace to a file.  By default, this  is  the  behavior  associated
       with   that   button.    This   behavior   can  be  redefined  by  setting  the  option  database  values
       *ErrorDialog.function.text,   to    specify    the    caption    for    the    function    button,    and
       *ErrorDialog.function.command, to specify the command to be run.  The text of the stack trace is appended
       to the command when it is evaluated.  If either of these options is set to the  empty  string,  then  the
       additional button will not be displayed in the dialog.

参见 SEE ALSO

       after(n), tclvars(n)

关键字 KEYWORDS

       background error, reporting

[中文版维护人]

       寒蝉退士

[中文版最新更新]

       2001/06/27

《中国 Linux 论坛 man 手册页翻译计划》:

       http://cmpp.linuxforum.net

       本页面中文版由中文 man 手册页计划提供。
       中文 man 手册页计划:https://github.com/man-pages-zh/manpages-zh