diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2011-04-04 13:40:01 (GMT) |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2011-04-04 13:40:01 (GMT) |
commit | d57b105d70bd7825ca19a8cafff3bc80da498820 (patch) | |
tree | eebeebaa58948935075500c432b9c53885fe1d6b /generic/tclCmdAH.c | |
parent | db0dc9c87d402903e79d5bc5fdb790127623a87c (diff) | |
download | tcl-d57b105d70bd7825ca19a8cafff3bc80da498820.zip tcl-d57b105d70bd7825ca19a8cafff3bc80da498820.tar.gz tcl-d57b105d70bd7825ca19a8cafff3bc80da498820.tar.bz2 |
Better error-message in case of errors related to setting a variable
FossilOrigin-Name: 0b4ce29050f3a92481c073d03bae5e44ec4bf790
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r-- | generic/tclCmdAH.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 3edfa54..8b5f13d 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -345,10 +345,7 @@ CatchObjCmdCallback( if (objc >= 3) { if (NULL == Tcl_ObjSetVar2(interp, varNamePtr, NULL, - Tcl_GetObjResult(interp), 0)) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, - "couldn't save command result in variable", NULL); + Tcl_GetObjResult(interp), TCL_LEAVE_ERR_MSG)) { return TCL_ERROR; } } @@ -356,11 +353,8 @@ CatchObjCmdCallback( Tcl_Obj *options = Tcl_GetReturnOptions(interp, result); if (NULL == Tcl_ObjSetVar2(interp, optionVarNamePtr, NULL, - options, 0)) { + options, TCL_LEAVE_ERR_MSG)) { Tcl_DecrRefCount(options); - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, - "couldn't save return options in variable", NULL); return TCL_ERROR; } } |