From: Lucas Cimon Date: Sun, 18 Nov 2018 13:48:05 +0000 (+0100) Subject: Improving error handling in awstats_buildstaticpages.pl X-Git-Tag: AWSTATS_7_8~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc0b88f925fdcd03da23f84692a8781ad5bfac00;p=thirdparty%2FAWStats.git Improving error handling in awstats_buildstaticpages.pl --- diff --git a/tools/awstats_buildstaticpages.pl b/tools/awstats_buildstaticpages.pl index 7d89bd04..ce04bb75 100755 --- a/tools/awstats_buildstaticpages.pl +++ b/tools/awstats_buildstaticpages.pl @@ -380,6 +380,7 @@ if ($Update) { $command .= " -databasebreak=$DatabaseBreak" if defined $DatabaseBreak; print "Launch update process : $command\n"; $retour=`$command 2>&1`; + if ($?) { print $retour; exit $?; } } # Built the OutputSuffix value (used later to build page name) @@ -437,6 +438,7 @@ if ($DatabaseBreak) { $smallcommand.=" -databasebreak=$DatabaseBreak"; } my $command="$smallcommand -output"; print "Build main page: $command\n"; $retour=`$command 2>&1`; +if ($?) { print $retour; exit $?; } $OutputFile=($OutputDir?$OutputDir:"")."awstats.$OutputSuffix.$StaticExt"; open("OUTPUT",">$OutputFile") || error("Couldn't open log file \"$OutputFile\" for writing : $!"); print OUTPUT $retour; @@ -449,6 +451,7 @@ for my $output (@OutputList) { my $command="$smallcommand -output=$output"; print "Build $output page: $command\n"; $retour=`$command 2>&1`; + if ($?) { print $retour; exit $?; } $OutputFile=($OutputDir?$OutputDir:"")."awstats.$OutputSuffix.$output.$StaticExt"; open("OUTPUT",">$OutputFile") || error("Couldn't open log file \"$OutputFile\" for writing : $!"); print OUTPUT $retour; @@ -464,6 +467,7 @@ if ($QueryString =~ /(^|-|&)buildpdf/i) { my $command="\"$HtmlDoc\" -t pdf --webpage --quiet --no-title --textfont helvetica --left 16 --bottom 8 --top 8 --browserwidth 800 --headfootsize 8.0 --fontsize 7.0 --header xtx --footer xd/ --outfile $OutputFile @pages\n"; print "Build PDF file : $command\n"; $retour=`$command 2>&1`; + if ($?) { print $retour; exit $?; } my $signal_num=$? & 127; my $dumped_core=$? & 128; my $exit_value=$? >> 8;