http://purl.org/tcl/home/man/tcl8.4/TclCmd/bgerror.htm is the official man page.
[fill in useful tricks and examples for using bgerror]
Does the documentation describe the calling convention? I didn't notice it. My experience is that the error-handler invokes it as something like
bgerror [firstLineOf $::errorInfo]
During development, one might rush a hack like
proc bgerror message { puts stderr "An event-based script faulted with '$message'." }
into use.
---
Ken: I want to enquire what is the best method if i got a proc that runs every 20s like the follow code but i want to catch its errors if any of the proc that run afterwards run into errors? I heard using bgerror is not recommended, so what is the best method?
proc a { } {
after 1000 a }
Tcl syntax help Arts and crafts of Tcl-tk programming Category Command