summaryrefslogtreecommitdiffstats
path: root/generic/tclPipe.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-04-03 06:05:13 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-04-03 06:05:13 (GMT)
commit2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4 (patch)
tree261625244d376d9a2c2415ce97c8a93bdc2304f6 /generic/tclPipe.c
parentfcf7bbf6ec9bc4d484960cf51acdab44bca2683a (diff)
downloadtcl-2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4.zip
tcl-2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4.tar.gz
tcl-2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4.tar.bz2
More generation of error codes (namespace creation, path normalization,
pipeline creation, package handling, procedures, [scan] formats)
Diffstat (limited to 'generic/tclPipe.c')
-rw-r--r--generic/tclPipe.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/generic/tclPipe.c b/generic/tclPipe.c
index c24d136..5f59c38 100644
--- a/generic/tclPipe.c
+++ b/generic/tclPipe.c
@@ -109,6 +109,8 @@ FileForRedirect(
Tcl_AppendResult(interp, "channel \"",
Tcl_GetChannelName(chan), "\" wasn't opened for ",
((writing) ? "writing" : "reading"), NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC",
+ "BADCHAN", NULL);
}
return NULL;
}
@@ -151,6 +153,7 @@ FileForRedirect(
badLastArg:
Tcl_AppendResult(interp, "can't specify \"", arg,
"\" as last word in command", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "SYNTAX", NULL);
return NULL;
}
@@ -342,6 +345,8 @@ TclCleanupChildren(
} else {
Tcl_AppendResult(interp,
"child wait status didn't make sense\n", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC",
+ "ODDWAITRESULT", msg1, NULL);
}
}
}
@@ -539,6 +544,8 @@ TclCreatePipeline(
if ((i == (lastBar + 1)) || (i == (argc - 1))) {
Tcl_SetResult(interp, "illegal use of | or |& in command",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC",
+ "PIPESYNTAX", NULL);
goto error;
}
}
@@ -565,6 +572,8 @@ TclCreatePipeline(
if (inputLiteral == NULL) {
Tcl_AppendResult(interp, "can't specify \"", argv[i],
"\" as last word in command", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC",
+ "PIPESYNTAX", NULL);
goto error;
}
skip = 2;
@@ -673,6 +682,8 @@ TclCreatePipeline(
if (i != argc-1) {
Tcl_AppendResult(interp, "must specify \"", argv[i],
"\" as last word in command", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC",
+ "PIPESYNTAX", NULL);
goto error;
}
errorFile = outputFile;
@@ -713,6 +724,8 @@ TclCreatePipeline(
Tcl_SetResult(interp, "illegal use of | or |& in command",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "PIPESYNTAX",
+ NULL);
goto error;
}
@@ -1063,11 +1076,15 @@ Tcl_OpenCommandChannel(
if ((flags & TCL_STDOUT) && (outPipe == NULL)) {
Tcl_AppendResult(interp, "can't read output from command:"
" standard output was redirected", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC",
+ "BADREDIRECT", NULL);
goto error;
}
if ((flags & TCL_STDIN) && (inPipe == NULL)) {
Tcl_AppendResult(interp, "can't write input to command:"
" standard input was redirected", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC",
+ "BADREDIRECT", NULL);
goto error;
}
}
@@ -1078,6 +1095,7 @@ Tcl_OpenCommandChannel(
if (channel == NULL) {
Tcl_AppendResult(interp, "pipe for command could not be created",
NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "EXEC", "NOPIPE", NULL);
goto error;
}
return channel;