diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-21 08:11:21 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-21 08:11:21 (GMT) |
commit | ed7fb54396eee6e5122bfe611b2a14cf422970fa (patch) | |
tree | 2155194029aa5ccfd6cdf90913ff12109c494add /generic/tkCanvImg.c | |
parent | f4db69f3300fe5cdb3da35c67bf608674950a72c (diff) | |
download | tk-ed7fb54396eee6e5122bfe611b2a14cf422970fa.zip tk-ed7fb54396eee6e5122bfe611b2a14cf422970fa.tar.gz tk-ed7fb54396eee6e5122bfe611b2a14cf422970fa.tar.bz2 |
consistent error formatting, added error codes
Diffstat (limited to 'generic/tkCanvImg.c')
-rw-r--r-- | generic/tkCanvImg.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index b92659b..172f26d 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -245,10 +245,13 @@ ImageCoords( } else if (objc != 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 2, got %d", objc)); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "IMAGE", + NULL); return TCL_ERROR; } } - if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], &imgPtr->x) != TCL_OK) + if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], + &imgPtr->x) != TCL_OK) || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1], &imgPtr->y) != TCL_OK)) { return TCL_ERROR; @@ -257,6 +260,7 @@ ImageCoords( } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 0 or 2, got %d", objc)); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "IMAGE", NULL); return TCL_ERROR; } return TCL_OK; |