Use structured exception to report an unsigned directive
authorJacob Bachmeyer <jcb@gnu.org>
Sat, 5 Nov 2022 21:28:00 +0000 (16:28 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Sat, 5 Nov 2022 21:28:00 +0000 (16:28 -0500)
gatekeeper.pl

index 5f54ca2e22cf10aff684a631de23cb41f0429e22..c8d59cbac207735084f185ac2f35e40442ef4988 100755 (executable)
@@ -2630,12 +2630,14 @@ foreach my $packet (@packets) { # each list element is an array reference
   eval {       # trap exceptions encountered while processing a packet
     local $Phase = 'PV';
     $directive_text = slurp_clearsigned_message($packet->[0]);
-    $directive = read_directive_from_string($directive_text);
 
     # This would imply that the directive file did not contain a signed
     # message.  There is nothing further to do.
-    fatal("directive file $directive_file has no signature",0)
-      if $directive_text eq '';
+    throw directive_syntax => trace => [],
+      summary => "directive file $packet->[0] has no signature"
+       if $directive_text eq '';
+
+    $directive = read_directive_from_string($directive_text);
 
     # this function just updates $info{email}
     guess_email_address_from_signature($directive_text);