bug in 8.4.14 return -code error?
- From: Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Jan 2007 17:05:37 GMT
I'm seeing what looks like buggy behavior with "return -code error" in 8.4.14. Is this familiar to anyone, and can anyone else reproduce the buggy behavior?
In the code at the end of this post, running under 8.4.14 on windows, I get the following output:
error reported via return:
errorCode: NULL
errorInfo:
error reported via error:
errorCode: CUSTOM errorCode
errorInfo: custom errorInfo
When I run the same code with 8.5a4, the errorCode and errorInfo is identical in both cases (specifically, they both resemble what is reported via error in the above output)
The code:
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
--
Bryan Oakley
www.tclscripting.com
.
- Follow-Ups:
- Re: bug in 8.4.14 return -code error?
- From: Don Porter
- Re: bug in 8.4.14 return -code error?
- From: Don Porter
- Re: bug in 8.4.14 return -code error?
- From: Don Porter
- Re: bug in 8.4.14 return -code error?
- Prev by Date: Re: stdout lost when a script execs another script?
- Next by Date: Re: bug in 8.4.14 return -code error?
- Previous by thread: Set selection item for listbox
- Next by thread: Re: bug in 8.4.14 return -code error?
- Index(es):