From 233624a7a80f808f424e418dd0b3601d3a312ace Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 5 Nov 2022 16:52:24 -0500 Subject: [PATCH] Remove remaining calls to fatal These reflect system errors and are replaced with simple exceptions. --- gatekeeper.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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: $@"; } -- 2.25.1