Display warnings on process return
This commit is contained in:
parent
0e92592d17
commit
4e35cabf62
@ -62,7 +62,10 @@ sub do_work ($$$@)
|
||||
my $sax_handler = ProcessHandler->new($args);
|
||||
my $parser = XML::SAX::ParserFactory->parser( Handler => $sax_handler );
|
||||
|
||||
my $ret;
|
||||
eval {
|
||||
$SIG{'__WARN__'} = sub { log WARN, $_[0]; $ret .= ">>> ".$_[0]."\n"; };
|
||||
|
||||
$parser->parse_string(${ $_[0]{argref} });
|
||||
};
|
||||
if ($@) {
|
||||
@ -71,7 +74,6 @@ sub do_work ($$$@)
|
||||
return $err;
|
||||
}
|
||||
|
||||
my $ret;
|
||||
eval {
|
||||
$ret = $subref->($given_args, $args);
|
||||
};
|
||||
|
@ -215,7 +215,7 @@ sub grades_new_bonus
|
||||
if (-e "$basedir/$year/$project_id/traces/bonus/$login.xml") {
|
||||
open my $xml, "<", "$basedir/$year/$project_id/traces/bonus/$login.xml" or die $!;
|
||||
binmode $xml;
|
||||
$trace = Trace->new($xml);
|
||||
$trace = Trace->new(join '', <$xml>);
|
||||
close $xml;
|
||||
}
|
||||
elsif ($delete) {
|
||||
@ -242,7 +242,7 @@ sub grades_new_bonus
|
||||
close $xml;
|
||||
}
|
||||
else {
|
||||
log WARN, "Invalid login $line, line skiped";
|
||||
warn "Invalid login $line, line skiped";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user