summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-09-20 13:05:04 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-09-20 13:05:04 (GMT)
commit47ced1720849a908ed78c0f0ab3bcd5da7722d4e (patch)
treed87f5fc372ba72c24be8d921d419362f05636546
parentc4175e0434a242a24610b0c3a70214885b897006 (diff)
downloadtcl-bug_unknown_no_errorcode.zip
tcl-bug_unknown_no_errorcode.tar.gz
tcl-bug_unknown_no_errorcode.tar.bz2
Potential fix for issues relating to lack of errorCode setting with unknown command handling.bug_unknown_no_errorcode
-rw-r--r--library/init.tcl9
1 files changed, 6 insertions, 3 deletions
diff --git a/library/init.tcl b/library/init.tcl
index 1ca6413..ff3a1e3 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -250,7 +250,8 @@ proc unknown args {
# Make sure we're not trying to load the same proc twice.
#
if {[info exists UnknownPending($name)]} {
- return -code error "self-referential recursion\
+ return -code error -errorcode [list TCL LOOKUP COMMAND $name] \
+ "self-referential recursion\
in \"unknown\" for command \"$name\""
}
set UnknownPending($name) pending
@@ -399,10 +400,12 @@ proc unknown args {
return -options $::tcl::UnknownOptions $::tcl::UnknownResult
}
if {[llength $cmds]} {
- return -code error "ambiguous command name \"$name\": [lsort $cmds]"
+ return -code error -errorcode [list TCL LOOKUP COMMAND $name] \
+ "ambiguous command name \"$name\": [lsort $cmds]"
}
}
- return -code error "invalid command name \"$name\""
+ return -code error -errorcode [list TCL LOOKUP COMMAND $name] \
+ "invalid command name \"$name\""
}
# auto_load --