From 32c0f4d6fb21b8b2aa03fd02b224bf8c962383fb Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 5 Nov 2022 16:28:00 -0500 Subject: [PATCH] Use structured exception to report an unsigned directive --- gatekeeper.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index 5f54ca2..c8d59cb 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -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); -- 2.25.1