From: Jacob Bachmeyer Date: Sat, 5 Nov 2022 21:52:24 +0000 (-0500) Subject: Remove remaining calls to fatal X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=233624a7a80f808f424e418dd0b3601d3a312ace;p=gatekeeper.git Remove remaining calls to fatal These reflect system errors and are replaced with simple exceptions. --- diff --git a/gatekeeper.pl b/gatekeeper.pl index c8d59cb..b99caf5 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -2448,7 +2448,8 @@ sub install_files { for my $f (($sig_file, $upload_file)) { my $stage = File::Spec->catfile($Stage_dir, $f); my @mv_args = ("/bin/mv", File::Spec->catfile($Scratch_dir, $f), $stage); - fatal("@mv_args failed",0) if system (@mv_args) != 0; + die 'command failed: '.join(' ', @mv_args) + if system (@mv_args) != 0; chmod 0644, $stage; } @@ -2457,9 +2458,9 @@ sub install_files { # be found by mirrors, etc. # rename $stage_signature, $final_signature - or fatal("rename($stage_signature, $final_signature) failed: $!",0); + or die "rename($stage_signature, $final_signature): $!"; rename $stage_upload, $final_upload - or fatal("rename($stage_upload, $final_upload) failed: $!",0); + or die "rename($stage_upload, $final_upload): $!"; } =item execute_commands ( $oplist ) @@ -2721,7 +2722,10 @@ foreach my $packet (@packets) { # each list element is an array reference mail($E->message,1); } } else { - # Exceptions thrown by perl itself come out as strings + # Exceptions thrown by perl itself come out as strings, as do simple + # exceptions thrown using die, used to reflect system errors like + # failures of commands or operations that we know should succeed, + # such as opening a file that we already know exists. warn "error during processing: $@"; }