Skip to content

Commit

Permalink
Only add warnings key to 'result' if there are warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed May 14, 2016
1 parent 912021b commit 39afb0d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/MetaCPAN/Queue.pm
Expand Up @@ -45,11 +45,16 @@ sub startup {
local @ARGV = @args;
try {
my $release = MetaCPAN::Script::Runner->run(@args);
$job->finish( { warnings => \@warnings } );
$job->finish( @warnings ? { warnings => \@warnings } : () );
}
catch {
warn $_;
$job->fail( { message => $_, warnings => \@warnings } );
$job->fail(
{
message => $_,
@warnings ? ( warnings => \@warnings ) : (),
}
);
};
}
);
Expand Down

0 comments on commit 39afb0d

Please sign in to comment.