From 08b228a77ffcbea7d14ba01537f4de73fd33528d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 5 Feb 2024 18:09:29 -0800 Subject: [PATCH] server: add error-checking to demo_submit script --- tools/demo_submit | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/demo_submit b/tools/demo_submit index 945f2e6a730..ec30c899b86 100755 --- a/tools/demo_submit +++ b/tools/demo_submit @@ -53,7 +53,10 @@ for ($i=2; $i<$argc; $i++){ if (!is_file($fname)) { die("no such file: $fname\n"); } - system("cp $fname `bin/dir_hier_path $fname`"); + system("cp $fname `bin/dir_hier_path $fname`", $ret); + if ($ret) { + die("Couldn't stage file\n"); + } $file_list[] = $fname; } @@ -63,7 +66,10 @@ $wu_name = sprintf('%s_%d', $appname, time()); $cmd = sprintf('bin/create_work --appname %s --wu_name %s %s', $appname, $wu_name, implode(' ', $file_list) ); -system($cmd); +system($cmd, $ret); +if ($ret) { + die("Couldn't create job\n"); +} echo "Job name: $wu_name\n";