In sgmlparser.tcl, when an error is thrown in user
code, the error is caught and rethrown by executing
return -code $code -errorinfo $::errorInfo $msg
However, this statement failed to pass along the value
of errorCode, so the global errorCode is reseted to
NONE. The correct code should be
return -code $code -errorinfo $::errorInfo \ -errorcode $::errorCode $msg
I corrected the code and included the diff file.
Diff file of sgmlparser.tcl
Logged In: YES
user_id=81778
The patch will be included in the 3.1 release.