Display important warnings on process return
This commit is contained in:
parent
4e35cabf62
commit
c5a1bf8917
@ -62,9 +62,9 @@ sub do_work ($$$@)
|
||||
my $sax_handler = ProcessHandler->new($args);
|
||||
my $parser = XML::SAX::ParserFactory->parser( Handler => $sax_handler );
|
||||
|
||||
my $ret;
|
||||
my @retW;
|
||||
eval {
|
||||
$SIG{'__WARN__'} = sub { log WARN, $_[0]; $ret .= ">>> ".$_[0]."\n"; };
|
||||
$SIG{'__WARN__'} = sub { log WARN, $_[0]; push @retW, $_[0]; };
|
||||
|
||||
$parser->parse_string(${ $_[0]{argref} });
|
||||
};
|
||||
@ -74,14 +74,17 @@ sub do_work ($$$@)
|
||||
return $err;
|
||||
}
|
||||
|
||||
my $ret;
|
||||
eval {
|
||||
$ret = $subref->($given_args, $args);
|
||||
};
|
||||
if ($@) {
|
||||
my $err = $@;
|
||||
log ERROR, $err;
|
||||
return $err;
|
||||
$ret = $err;
|
||||
}
|
||||
|
||||
$ret .= ">>> ".$_."\n" foreach (@retW);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user