Index: ChangeLog =================================================================== diff -u -rc97e67e4e75de882fc249d0b43328c49600ad020 -r986b0a08b5168612ef730a8b575ddbffee9f0b14 --- ChangeLog (.../ChangeLog) (revision c97e67e4e75de882fc249d0b43328c49600ad020) +++ ChangeLog (.../ChangeLog) (revision 986b0a08b5168612ef730a8b575ddbffee9f0b14) @@ -1,3 +1,7 @@ +2012-01-14 + * xotcl.c Don't overwrite error messages from __unknown handler in + several situations (superclass, parameter class, mixin class) + 2012-01-12 * xotcl.c Backport from nsf: when processing arguments with leading dashes in "configure", accept only method names without Index: generic/xotcl.c =================================================================== diff -u -r3e2c28122dff054185286b89f145462fe7e967f2 -r986b0a08b5168612ef730a8b575ddbffee9f0b14 --- generic/xotcl.c (.../xotcl.c) (revision 3e2c28122dff054185286b89f145462fe7e967f2) +++ generic/xotcl.c (.../xotcl.c) (revision 986b0a08b5168612ef730a8b575ddbffee9f0b14) @@ -3307,10 +3307,14 @@ "' has too many elements.", (char *) NULL);*/ } - if (GetXOTclClassFromObj(interp, name, &mixin, 1) != TCL_OK) - return XOTclErrBadVal(interp, "mixin", "a class as mixin", ObjStr(name)); + if (GetXOTclClassFromObj(interp, name, &mixin, 1) != TCL_OK) { + char *errorString = ObjStr(Tcl_GetObjResult(interp)); + if (*errorString == '\0') { + XOTclErrBadVal(interp, "mixin", "a class as mixin", ObjStr(name)); + } + return TCL_ERROR; + } - new = CmdListAdd(mixinList, mixin->object.id, NULL, /*noDuplicates*/ 1); if (guard) { @@ -4872,9 +4876,13 @@ scl = NEW_ARRAY(XOTclClass*, oc); for (i = 0; i < oc; i++) { if (GetXOTclClassFromObj(interp, ov[i], &scl[i], 1) != TCL_OK) { + char *errorString = ObjStr(Tcl_GetObjResult(interp)); FREE(XOTclClass**, scl); - return XOTclErrBadVal(interp, "superclass", "a list of classes", - ObjStr(arg)); + if (*errorString == '\0') { + XOTclErrBadVal(interp, "superclass", "a list of classes", + ObjStr(arg)); + } + return TCL_ERROR; } } @@ -5204,13 +5212,17 @@ if (opt && opt->parameterClass) pcl = opt->parameterClass; - if (GetXOTclClassFromObj(interp, pcl,¶mCl, 1) == TCL_OK) { + result = GetXOTclClassFromObj(interp, pcl,¶mCl, 1); + if (result == TCL_OK) { result = XOTclCallMethodWithArgs((ClientData)paramCl, interp, method, arg, objc-2, objv, flags); + } else { + char *errorString = ObjStr(Tcl_GetObjResult(interp)); + if (*errorString == '\0') { + XOTclVarErrMsg(interp, "create: can't find parameter class", + (char *) NULL); + } } - else - result = XOTclVarErrMsg(interp, "create: can't find parameter class", - (char *) NULL); return result; }