Provided by:
manpages-zh_1.5.1-1_all 
NAME
bgerror - 為處理I景錯誤而被調用的命令
` SYNOPSIS
bgerror message
_________________________________________________________________
yz DESCRIPTION
bgerror 命令不作為 Tcl 內置部分而存在。如果單獨的某-
蚗野峏峔洏峈怬瘜B理I景錯誤,可以定義一 bgerror 命令(例如,作為一
Tcl 過程)。
I景錯誤發生在事件處理器(handler)或不是由應用發起(originate)的一些其他命令中。例如,如果在執行一-
茈 after 命令指定的一茤R令時發生了一蚇欞~,那麼這就是一-
I景錯誤。對於一茷DI景錯誤,通過嵌套的 Tcl 命令求(evaluation),
錯誤可以被簡單的向上返回,直到到達應用中的頂層代碼;則應用可以用任何它希望的方式來報告錯誤。
當一粄景錯誤發生時,在 Tcl 庫中終止命令解釋(unwinding ends ?
鬆開末端)並且沒有給 Tcl 用來報告錯誤明顯的途徑。
當 Tcl 檢測到一粄景錯誤時,它保存關於錯誤的信息並作為一-
茠韃4B理器而在以後調用 bgerror 命令。在調用 bgerror 之前,Tcl 把
fBerrorInfo 和 errorCode 變量的存儲成它怞b錯誤發生時的-
A接著用錯誤消息作為唯一的參數來調用 bgerror。Tcl 假定應用已經實現了
bgerror 命令,命令以對應用有意義的方式來報告錯誤。 Tcl 在 bgerror
命令沒有生成錯誤時忽略返回的任何結果。
如果在 bgerror 命令中發生了另一 Tcl 錯誤(例如,沒有定義 bgerror
命令)則 Tcl 通過向標準錯誤寫消息來處理這茼菬的錯誤。
在調用 bgerror 來處理錯誤之前如果積累了一些錯誤,將以發生的次序為每-
蚇欞~調用一次 bgerror。但是,如果 bgerror 以一 break
例外返回,則跳過所有的餘下的錯誤而不調用 bgerror。
Tcl 沒有預設的實現 bgerror。但是,在使用 Tk 的應用中有一蚢w設的
bgerror 過程,它貼出(post)一蚢儭飫堙A包含了錯誤訊息並向使用者提供一-
蚞鷛|來查看顯示在什麼地方發生錯誤的棧跟蹤。 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)
r KEYWORDS
background error, reporting
[]
Hhh
[]
2001/06/27
m Linux manUpn:
http://cmpp.linuxforum.net