On Tue, 16 Aug 2016 18:25:28 -0700, ddgr...@gmail.com wrote:
> Paraphrasing from IRC where my first comment starts here:
> http://irclog.perlgeek.de/perl6/2016-08-17#i_13035789
> 
> My feeling has always been that Perl 6's errors are good, but I'm
> sympathetic to whoever it was that complained that the list of
> "expecting any of" things wasn't all that helpful in the general case.
> Personally, I have never once gotten any useful information out of
> them, but the messages that precede them are very helpful. E.g., perl6
> -ne '.say if /asdf \s+ \/' gives the error message:
> 
> ===SORRY!===
> Regex not terminated.
> at -e:1
> ------> .say if /asdf \s+ \/⏏<EOL>
> Unable to parse regex; couldn't find final '/'
> at -e:1
> ------> .say if /asdf \s+ \/⏏<EOL>
>     expecting any of:
>         infix stopper
> 
> The first two parts are really helpful, but the "expecting any of" I
> ignore. I understand that people doing fancy grammar related things
> probably do find them very useful. However, my impression is that most
> people "in the wild" writing Perl (5 or 6) are frequently doing
> command line text manipulation and things like that (akin to my
> example). And for them, the first part of the error message is
> extremely useful and the second part isn't (IMHO).
> 
> So I propose turning the second part (i.e, "expecting any of" and
> things like that) off in the general case and adding a flag to turn it
> on (--grammar-errors?), like we already have for --ll-exceptions.


Thanks, but the PR was rejected.

I don't think the added maintenance burden and extra option the users have to 
read through justify the presence of this very minor feature that might not be 
desired by all.

We have since implemented `RAKUDO_EXCEPTIONS_HANDLER` env var[^1] that lets 
users use custom classes for error reporting (that allow filtering for custom 
handling for just specific exceptions; letting default handler handle the 
rest). So there's a possibility of implementing this feature entirely in a 
module; or expanding the idea further: `Exceptions::Simple` for example that 
give just the basics.

[1] 
https://docs.perl6.org/programs/00-running#Error_Message_Verbosity_and_Strictness

Reply via email to