Use structured exceptions for empty directive
authorJacob Bachmeyer <jcb@gnu.org>
Fri, 4 Nov 2022 00:03:40 +0000 (19:03 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Fri, 4 Nov 2022 00:03:40 +0000 (19:03 -0500)
gatekeeper.pl
testsuite/lib/gatekeeper.exp

index 1e7ee35427e6c1573b3e344c2fee928779e71281..e3bc84199a67aee9435c3febd03e9290edffc088 100755 (executable)
@@ -2099,12 +2099,14 @@ sub validate_commands {
   # Check that we actually have at least one command in the directive
   unless ($#$ops > 0) {
     if (1 == scalar @$packet) {
-      fatal("nothing to do - no commands in directive file",1);
+      throw directive_syntax => trace => $ops,
+       summary => 'nothing to do - no commands in directive file';
     } else {
       # Provide a different message if this looks like an upload packet.
-      fatal("no filename directive specified in $stem.directive.asc. "
-           ."Upgrade to the latest version! "
-           ."See http://www.gnu.org/prep/maintain/maintain.html",1)
+      throw directive_syntax => trace => $ops,
+       summary => "no filename element in $stem.directive.asc."
+         .' Upgrade to the latest version! '
+           .'See http://www.gnu.org/prep/maintain/maintain.html';
     }
   }
 
index 7eefcac6185d649f5194c3a072b80c999ad04da6..8a9b1f6c0fc088f444658d77ab226d3b65d59b4c 100644 (file)
@@ -721,7 +721,7 @@ proc analyze_log { base_dir name assess } {
                     exp_continue
                 }
        -re {^gatekeeper\[[0-9]+\]: \(Test\) \[PV\]\
-                no filename directive specified in ([^\r\n]+)[.]\
+                no filename element in ([^\r\n]+)[.]\
                 Upgrade to the latest version![^\r\n]+} {
                     # from read_directive_file, if no filename given
                     # This was valid in v1 but v1 is now obsolete.