Skip to content

Commit 6758a60

Browse files
committed
PAUSE::dist: do not include private errors in report
This case doesn't come up yet, and wasn't handled properly. This code will better handle private errors, and also errors with a header and no body.
1 parent 393a5ea commit 6758a60

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/PAUSE/dist.pm

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,22 @@ sub mail_summary {
480480
for my $error (@dist_errors) {
481481
my $header = $error->{header};
482482
my $body = $error->{body};
483-
$body = $body->($self) if ref $body;
484483

485-
push @m, "## $header\n\n";
486-
push @m, $tf->format($body), qq{\n\n};
484+
if ($error->{public}) {
485+
$body = $body->($self) if ref $body;
486+
487+
unless ($body) {
488+
$Logger->log([
489+
"encountered dist error with no body: %s",
490+
$error->{header},
491+
]);
492+
493+
$body = "No further information about this error is available.";
494+
}
495+
496+
push @m, "## $header\n\n";
497+
push @m, $tf->format($body), qq{\n\n};
498+
}
487499

488500
$status_over_all = "Failed";
489501
}

0 commit comments

Comments
 (0)