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