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