From 6f83e4389912967432260ead0db132f373a880bd Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Sat, 7 Sep 2013 19:20:30 +0200 Subject: break the habit of throwing away the actually useful error messages The lines that help dignose a problem is almost never the first one that just states "there was an error". The explanation of the error follows in the next lines. So don't quit immediately after the first error-line, but wait what the command has to tell and log/print the whole info. Change-Id: I2a4b3470b4b66ed37fa5e5a34d452c548d24b965 Reviewed-on: https://gerrit.libreoffice.org/5861 Reviewed-by: Thomas Arnhold Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens --- postprocess/signing/signing.pl | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'postprocess/signing') diff --git a/postprocess/signing/signing.pl b/postprocess/signing/signing.pl index 686e56afd6d6..fc17092594d5 100644 --- a/postprocess/signing/signing.pl +++ b/postprocess/signing/signing.pl @@ -208,17 +208,16 @@ sub execute #11.07.2007 10:02 { my $commandline = shift; my $result = ""; - - print "$commandline\n" if ($debug); - open(PIPE, "$commandline 2>&1 |") || die "Error: Cant open pipe!\n"; - while ( $result = ) { - print LOG "$result" if ($opt_log); # logging - if ( $result =~ /SignTool Error\:/ ) { - close PIPE; - print_error( "$result\n" ); - } # if error - } # while - close PIPE; + my $errorlines = ""; + + print "$commandline\n" if ($debug); + open(PIPE, "$commandline 2>&1 |") || die "Error: Cannot execute '$commandline' - $!\n"; + while ( $result = ) { + print LOG "$result" if ($opt_log); + $errorlines .= $result if ($result =~ /SignTool Error\:/); + } # while + close PIPE; + print_error( "$errorlines\n" ) if ($errorlines); } ##execute ############################################################################ -- cgit