You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've wasted more time than I should've the past few days trying to
understand what this message means. At a minimum the documentation should
be updated, but preferably the error message itself should be clarified.
The example on https://docs.perl6.org/language/traps is not entirely clear,
and did not at all match the scenario I was hitting. The provided stack
trace also fails to point to the source of the issue.
A trivialized example:
say "Test await after fulfillment";
my $p = Promise.new();
my $vow = $p.vow;
$vow.break(1);
await $p;
Results in:
An operation first awaited:
in block <unit> at ../test.pl6 line 5
Died with the exception:
1
in block <unit> at ../test.pl6 line 5
This haiku-like message simply means that the Promise/Vow has been broken.
Farther, the exception points to the "await $p" line, when it's really the
"$vow.break" line that's responsible for the trouble.
I'd suggest a better error message in this case (if possible) would be
something like:
*A Promise was broken by ../test.pl6 line 4 awaited upon*
in block <unit> at ../test.pl6 line 5
Died with the exception:
1
in block <unit> at ../test.pl6 line 5
Just trying to do my part to make Perl6 better ;-)
- David
p6rt
added
the
LTA
Less Than Awesome; typically an error message that could be better
label
Jan 5, 2020
Migrated from rt.perl.org#132835 (status was 'new')
Searchable as RT132835$
The text was updated successfully, but these errors were encountered: