Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"An operation first awaited" error needs to be clearer #6671

Open
p6rt opened this issue Feb 8, 2018 · 1 comment
Open

"An operation first awaited" error needs to be clearer #6671

p6rt opened this issue Feb 8, 2018 · 1 comment
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Feb 8, 2018

Migrated from rt.perl.org#132835 (status was 'new')

Searchable as RT132835$

@p6rt
Copy link
Author

p6rt commented Feb 8, 2018

From david@empireofgames.com

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 p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant