TEST2::EVENT::EXCEPTION(3perl)
π Test2::Event::Exception β the manual page, but make it cute
okay so bestie, say hi to Test2::Event::Exception from the Perl Programmers Reference Guide (that's the 3perl section, iykyk). It's a whole little module for when something goes wrong wrong and you need the test suite to Know About It. β¨
π NAME π
Test2::Event::Exception β the Exception event πβ¨
π DESCRIPTION π
So basically: an exception event is that girl who shows up to STDERR to announce the drama. π’
And not only does it spill all the tea to STDERR β it literally prevents the overall test file from passing. No passing grade for you, babes. The test file is not passing. It's giving "you shall not pass" but make it Perl. π«π
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste ready, no cap:
use Test2::API qw/context/;
use Test2::Event::Exception;
my $ctx = context();
my $event = $ctx->send_event('Exception', error => 'Stuff is broken');
that's it, that's the whole thing. iconic. π«Ά
β¨ METHODS β¨
Inherits from Test2::Event (so it's already got the family genes π). Also defines:
$reason = $e->errorβ this is where you find out why the exception happened. The reason. The lore. The whole backstory. π
π CAVEATS π
Heads up bestie: all exceptions are stringified during construction. So whatever you throw at it, it becomes a string. That's just the rule. Not me being dramatic, that's literally what the page says. π
π¦ SOURCE π¦
The source code repository for Test2 can be found at <https://github.com/Test-More/test-more/>.
(ngl go look at it, it's a whole museum of test-y goodness ποΈβ¨)
π MAINTAINERS π
Chad Granum <exodist@cpan.org> β the main character maintaining all of this π
β AUTHORS β
Chad Granum <exodist@cpan.org> β yes, same icon, still carrying the whole thing π«‘
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <https://dev.perl.org/licenses/>
and that's the whole page, bestie π§ no skips, no shortcuts, every single deet preserved. this was perl v5.44.0, dated 2026-10-17, page Test2::Event::Exception(3perl) β mwah, slay, periodt. πβ¨π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms