aboutsummaryrefslogtreecommitdiff
path: root/ccwl/ccwl.scm
diff options
context:
space:
mode:
authorArun Isaac2023-10-14 00:55:57 +0100
committerArun Isaac2023-10-14 00:55:57 +0100
commit3063c33634d4a25ba99a2c884dd8bf04e519f914 (patch)
treef2fc1822a0ade7cc6fb7d38fe25c1ec7d46eff88 /ccwl/ccwl.scm
parenta310aa43c3907fae62156be5478a3dacbb4e92f8 (diff)
downloadccwl-3063c33634d4a25ba99a2c884dd8bf04e519f914.tar.gz
ccwl-3063c33634d4a25ba99a2c884dd8bf04e519f914.tar.lz
ccwl-3063c33634d4a25ba99a2c884dd8bf04e519f914.zip
ccwl: Detect multiple expressions in workflow body.
* ccwl/ccwl.scm (workflow): Detect multiple expressions in workflow body and raise an exception. * tests/ccwl.scm ("unrecognized workflow syntaxes must raise a &ccwl-violation condition"): Test for the formatted message too. ("multiple expressions in workflow body must raise a &ccwl-violation condition"): New test.
Diffstat (limited to 'ccwl/ccwl.scm')
-rw-r--r--ccwl/ccwl.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index d9d9c78..f64830c 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -615,6 +615,18 @@ a <key> object, in STEPS, a list of <step> objects. If no such
(list #,@(filter-map (cut key->output <> steps)
output-keys))
'())))
+ ;; Guess that these are multiple unconnected expressions in the
+ ;; workflow body, and try to produce a helpful error message.
+ ((_ (inputs ...) expressions ...)
+ (raise-exception
+ (condition
+ (ccwl-violation x)
+ (formatted-message "More than one expression ~a in workflow body. Perhaps you need to combine them with a pipe or a tee?"
+ (string-join
+ (map (lambda (expression)
+ (call-with-output-string
+ (cut write expression <>)))
+ (syntax->datum #'(expressions ...))))))))
(x
(raise-exception
(condition (ccwl-violation #'x)