From 160d321a1b4f0525fbd61a5355b8d52eeef99ddc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 28 Jul 2009 18:14:58 +0100 Subject: [PATCH] better error messages from pipethrough_* --- pctb/Commods.pm | 10 +++++----- pctb/commod-email-processor | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pctb/Commods.pm b/pctb/Commods.pm index 183eb96..d9a2a94 100644 --- a/pctb/Commods.pm +++ b/pctb/Commods.pm @@ -206,14 +206,14 @@ sub pipethrough_run_along ($$$@) { if (!$child) { open STDIN, "<&", $tf; &$childprep() if defined $childprep; - exec $cmd @a; die $!; + exec $cmd @a; die "@a $!"; } return $fh; } -sub pipethrough_run_finish ($) { - my ($fh)= @_; +sub pipethrough_run_finish ($$) { + my ($fh, $what)= @_; $fh->error and die $!; - close $fh or die "$! $?"; die $? if $?; + close $fh or die "$what $! $?"; die $? if $?; } sub pipethrough_run ($$$@) { @@ -222,7 +222,7 @@ sub pipethrough_run ($$$@) { my $r; { undef $/; $!=0; $r= <$pt>; } defined $r or die $!; - pipethrough_run_finish($pt); + pipethrough_run_finish($pt, "@a"); return $r; } sub pipethrough_run_gzip ($) { diff --git a/pctb/commod-email-processor b/pctb/commod-email-processor index 28a7082..b7883fc 100755 --- a/pctb/commod-email-processor +++ b/pctb/commod-email-processor @@ -161,7 +161,7 @@ sub main () { } - pipethrough_run_finish($pt); + pipethrough_run_finish($pt, 'gunzip <$deduped_tsv.gz'); } -- 2.30.2