Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 359c59c1f3b1df6377739243067d782b63cbd941
Ticket: 1649062fffffffffffffffffffffffffffffffff
incompat in ::errorInfo/::errorCode maintenance
User & Date: boakley on 2007-01-31 17:39:54
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    It appears that in 8.4.14 (I don't know about earlier versions...) "return -code error -errorcode xxx" doesn't work. The proper behavior (IMO) is seen in 8.5a4 FWIW. It is the "-errorcode xxx" part that doesn't seem to work.
    
    I expect to get the same results whether I use "return -code error" or "error" but I get different results on 8.4.14 with the following code (on Windows XP):
    
    proc main {} {
        foo return
        foo error
    }
    
    proc foo {what} {
        set ::errorCode NULL
        set ::errorInfo ""
        if {[catch {
            if {$what == "error"} {
                error \
                    "error reported via error" \
                    "custom errorInfo" \
                    [list CUSTOM errorCode]
    
            } else {
                return \
                    -code error \
                    -errorinfo "custom errorInfo" \
                    -errorcode [list CUSTOM  errorCode] \
                    "error reported via return"
            }
        } err]} {
            puts $err:
            puts "  errorCode: $::errorCode"
            puts "  errorInfo: $::errorInfo"
            puts ""
        }
    }
    main
    exit 0
    
    Here is what I get with 8.4.14:
    
    error reported via error:
      errorCode: CUSTOM errorCode
      errorInfo: custom errorInfo
    
    error reported via return:
      errorCode: NULL
      errorInfo: 
    
    This is what I get with 8.5a4:
    
    error reported via error:
      errorCode: CUSTOM errorCode
      errorInfo: custom errorInfo
    
    error reported via return:
      errorCode: CUSTOM errorCode
      errorInfo: custom errorInfo
    
    
    
  4. foundin changed to: "obsolete: 8.4.14"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "boakley"
  10. subsystem changed to: "18. Commands M-Z"
  11. title changed to:
    return -code error -errorcode xxx doesn't seem to work right
    
  12. type changed to: "Bug"