summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2007-09-07 15:51:24 (GMT)
committerdgp <dgp@noemail.net>2007-09-07 15:51:24 (GMT)
commit9d41a87a6e65a4d04743be29d28f2590933a7ee0 (patch)
tree1004390eda2e52d8425094b14c5693604de37d1f /generic/tclResult.c
parent2b1bf3e58c2191447317a248d00c6848c2585c43 (diff)
downloadtcl-9d41a87a6e65a4d04743be29d28f2590933a7ee0.zip
tcl-9d41a87a6e65a4d04743be29d28f2590933a7ee0.tar.gz
tcl-9d41a87a6e65a4d04743be29d28f2590933a7ee0.tar.bz2
* generic/tclResult.c (Tcl_GetReturnOptions): Take care that a
* tests/init.test: non-TCL_ERROR code doesn't cause existing -errorinfo, -errorcode, and -errorline entries to be omitted. * generic/tclEvent.c: With -errorInfo no longer lost, generate more complete ::errorInfo when calling [bgerror] after a non-TCL_ERROR background exception. FossilOrigin-Name: f4e64b0c796abb30d68ac3011b09e7913e25a937
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r--generic/tclResult.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c
index c77e634..64be014 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclResult.c,v 1.37 2007/06/05 17:57:08 dgp Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.38 2007/09/07 15:51:26 dgp Exp $
*/
#include "tclInt.h"
@@ -1452,14 +1452,13 @@ Tcl_GetReturnOptions(
}
if (result == TCL_ERROR) {
- /*
- * When result was an error, fill in any missing values for
- * -errorinfo, -errorcode, and -errorline.
- */
-
Tcl_AddObjErrorInfo(interp, "", -1);
- Tcl_DictObjPut(NULL, options, keys[KEY_ERRORINFO], iPtr->errorInfo);
+ }
+ if (iPtr->errorCode) {
Tcl_DictObjPut(NULL, options, keys[KEY_ERRORCODE], iPtr->errorCode);
+ }
+ if (iPtr->errorInfo) {
+ Tcl_DictObjPut(NULL, options, keys[KEY_ERRORINFO], iPtr->errorInfo);
Tcl_DictObjPut(NULL, options, keys[KEY_ERRORLINE],
Tcl_NewIntObj(iPtr->errorLine));
}