Sat, 09-Jun-2012 by Karen Pauley edit post
throws_like
to Test::Util
which makes testing of typed exceptions very easy.
**D3: Implementation, tests, documentation**
Rakudo now throws only typed exceptions from its setting (with the exception of internal errors). Note that before my work started it only allowed strings as exceptions.
The tests mentioned above already cover several bug reports where people complained about wrong or less-than-awesome error messages. Since my main motivation was to make error testing more robust, I consider this a big success.
Documentation for "compiler writers":https://github.com/perl6/mu/blob/master/docs/exceptions.pod and "test authors":https://github.com/perl6/roast/blob/master/packages/Test/Util.pm#L177 is available.
Other Exceptions Progress
I'd also like to mention that I did several things related to exceptions which were not covered by this grant:
* "greatly improved backtrace printer":http://perlgeek.de/blog-en/perl-6/2011-02-exceptions.writeback
* Many exceptions from within the compilation process (such as parse errors, redeclarations etc.) are now typed.
* I enabled typed exceptions thrown from C code, and as a proof of concept I ported all user-visible exceptions in "perl6.ops":https://github.com/rakudo/rakudo/blob/nom/src/ops/perl6.ops to their intended types.
* "Exceptions from within the meta model":https://github.com/rakudo/rakudo/commit/ecf355fa54492999de368a4ca1aed21a016470ec can now be caught in the "actions" part of the compiler, augmented with line numbers and file name and re-thrown
* The Rakudo developers usually only close bug reports when tests are available. I wrote many tests for specific error conditions in response to such bug reports and closed the tickets.
Acknowledgements
I'd like to thank Ian Hague and the Perl Foundation for funding this grant, Karen Pauley and Will Coleda for managing it, and all the people who helped me designing, programming and wording things, especially Jonathan Worthington.
References
* "Grant appliacation":http://news.perlfoundation.org/2011/02/hague-grant-application-struct.html
* "Grant acceptance":http://news.perlfoundation.org/2011/04/structured-error-message-grant.html
* "First report (April 2011)":http://perlgeek.de/blog-en/perl-6/grant-report-errors-1.html
* "Second report (May 2011)":http://perlgeek.de/blog-en/perl-6/grant-report-errors-2.html
* "Third report (August 2011)":http://perlgeek.de/blog-en/perl-6/grant-report-errors-3.html
* "Fourth report (December 2011)":http://perlgeek.de/blog-en/perl-6/grant-report-errors-4.html
* "Exceptions status update (February 2012)":http://perlgeek.de/blog-en/perl-6/2011-02-exceptions.html
* "Oslo Hackathon Day 1: Fixes to the backtrace printer":http://perlgeek.de/blog-en/perl-6/2012-oslo-hackathon-report.html
* "Report May 2012":http://perlgeek.de/blog-en/perl-6/2012-grant-report-exceptions-may.html
* "Final report (June 2012)":http://perlgeek.de/blog-en/perl-6/2012-grant-report-final-status-update.html
* "Localization of Error Messages":http://perlgeek.de/blog-en/perl-6/2012-localizing-exceptions.html
The Perl Foundation - supporting the Perl community since 2000. Find out more at www.perlfoundation.org.