Overview
| Artifact ID: | 7725b911a4b007e6dfcb9b4be38d3666fa5b4259 |
|---|---|
| Ticket: | 218685ffffffffffffffffffffffffffffffffff
auto_load errors: don't prune errorInfo |
| User & Date: | nobody on 2000-10-26 01:04:07 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 1734 RFE Version: 8.1b2 SubmitDate: '1999-04-06' LastModified: '2000-02-01' Severity: MED Status: Released Submitter: pat ChangedBy: ericm OS: All FixedDate: '2000-02-01' FixedInVersion: 8.3 ClosedDate: '2000-10-25' Name: Don Porter Comments: The same mis-feature is present in the 8.0.x sources. If this patch is adopted, please apply it to both development branches. DesiredBehavior: When an error occurs in the auto-loading of a command, [unknown] catches and re-raises the error. In the process, all details of the calling stack trace are lost. This can make it difficult to locate the cause of the error when debugging auto-load scripts. [unknown] also prepends the string "error while autoloading \"$name\": " to the error message. This information says something about the context in which the error was raised, nothing about the error itself. The proper place to record context information about an error is in the global errorInfo variable. When several auto-loads get nested, the prepended strings add up to create a long confusing line before getting to the point : what the error is. The simple patch provided corrects both problems by preserving $errorInfo when re-raising the error, and appending to errorInfo the contextual information that the error occured while autoloading. Patch: Index: init.tcl =================================================================== RCS file: /cvsroot/tcl/library/init.tcl,v retrieving revision 1.1.2.7 diff -c -r1.1.2.7 init.tcl *** init.tcl 1999/03/13 23:49:48 1.1.2.7 --- init.tcl 1999/04/06 15:50:08 *************** *** 183,190 **** set ret [catch {auto_load $name [uplevel 1 {namespace current}]} msg] unset unknown_pending($name); if {$ret != 0} { ! return -code $ret -errorcode $errorCode \ ! "error while autoloading \"$name\": $msg" } if {![array size unknown_pending]} { unset unknown_pending --- 183,190 ---- set ret [catch {auto_load $name [uplevel 1 {namespace current}]} msg] unset unknown_pending($name); if {$ret != 0} { ! append errorInfo "\n (autoloading \"$name\")" ! return -code $ret -errorcode $errorCode -errorinfo $errorInfo $msg } if {![array size unknown_pending]} { unset unknown_pending PatchFiles: init.tcl I applied this patch to the 8.3 final sources. Thanks. - eric -- 02/01/2000 ericm - foundin changed to: "obsolete: 8.1b2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "56. LibTomMath"
- title changed to: "auto_load errors: don't prune errorInfo"
- type changed to: "Bug"