Subject: | repeat does not capture failure of 'while' etc.. conditions |
This correctly captures failure:
my $f = repeat {
die "I failed in body"
} while => sub { 0 };
$f->failure and print STDERR "Future caught failure: " . $f->failure;
output:
Future caught failure: I failed in body at ...
This doesn't:
my $f = repeat {
Future->done
} while => sub { die "I failed in the while condition" };
$f->failure and print STDERR "Future caught failure: " . $f->failure;
Output:
I failed in the while condition at ...
--
Paul Evans