Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7725b911a4b007e6dfcb9b4be38d3666fa5b4259
Ticket: 218685ffffffffffffffffffffffffffffffffff
auto_load errors: don't prune errorInfo
User & Date: nobody on 2000-10-26 01:04:07
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. 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
    
  4. foundin changed to: "obsolete: 8.1b2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "56. LibTomMath"
  10. title changed to: "auto_load errors: don't prune errorInfo"
  11. type changed to: "Bug"