Hi everyone,
I got annoyed by the one ::errorInfo. At my work there are places where you want to see a few errors back. I wrote a script that tracks the errors and stores them, so it is possible to view past errorInfos. It is quite handy from time to time.
I looked for something like this and did not find anything. Hope this helps someone.
Any feedback/issues can be reported to the repository or through here.
A sort of quick-and-dirty variant on this:
proc logErrors {varName args} { upvar 0 $varName var if {![info exists var] || [string length $::errorInfo] < [string length [lindex $var end]]} { lappend var $::errorCode $::errorInfo } else { lset var end $::errorInfo } }
Set a trace with a fully-qualified variable name as argument:
This variable will collect an even-sized list of error codes and stack traces. This list can be pretty-printed e.g. like this: