Overview
| Artifact ID: | e22975eee728270c31a21c69889674ef7d908d8c |
|---|---|
| Ticket: | 2038069fffffffffffffffffffffffffffffffff
Too much errorinfo at catch |
| User & Date: | lars_h on 2008-08-04 21:42:19 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
This is an issue where a bytecompiled [catch] behaves differently from an interpreted [catch]. It is present in 8.5, today's CVS HEAD (8.6a1 with NRE), and at least 8.4 too (haven't checked with any 8.3 or earlier). The issue is probably clearest in 8.5 (this is .0): % proc compiled {prefix script} {list [catch [lappend prefix $script] res info] $res $info} % proc interpreted {prefix script} {list [eval {catch [lappend prefix $script] res info}] $res $info} (Same code, except for the [eval] around the [catch] in the latter. Changing the command substitution to a variable substitution did not seem to make a difference.) % compiled {uplevel #0} {error FOO} 1 FOO {-code 1 -level 0 -errorcode NONE -errorinfo {FOO while executing "error FOO" ("uplevel" body line 1) invoked from within "uplevel #0 {error FOO}" invoked from within "catch [lappend prefix $script] res info"} -errorline 1} % interpreted {uplevel #0} {error FOO} 1 FOO {-code 1 -level 0 -errorcode NONE -errorinfo {FOO while executing "error FOO" ("uplevel" body line 1) invoked from within "uplevel #0 {error FOO}"} -errorline 1} Thus: the compiled [catch] includes itself in the -errorinfo, whereas the interpreted does not. IMHO the latter is more correct. (If there was also a reliable way of dropping the [uplevel] I'd be all ears, but I can live with that.) In today's 8.6a1+NRE, the compiled result is slightly different, but the interpreted result stays the same: % compiled {uplevel #0} {error FOO} 1 FOO {-code 1 -level 0 -errorcode NONE -errorinfo {FOO while executing "error FOO" ("uplevel" body line 1) invoked from within "catch [lappend prefix $script] res info"} -errorline 1} % interpreted {uplevel #0} {error FOO} 1 FOO {-code 1 -level 0 -errorcode NONE -errorinfo {FOO while executing "error FOO" ("uplevel" body line 1) invoked from within "uplevel #0 {error FOO}"} -errorline 1} I actually find this compiled behaviour a change to the worse, because it places greater emphasis on irrelevant details (how the command being caught is constructed and caught) while hiding some more relevant details (what the command being caught is). - foundin changed to: "obsolete: 8.6a1"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "lars_h"
- subsystem changed to: "47. Bytecode Compiler"
- title changed to: "Too much errorinfo at catch"
- type changed to: "Bug"