TEST2::EVENT::BAIL(3pm)

πŸ’… Test2::Event::Bail β€” the Test2::Event::Bail page, bestie edition

okay so this is Test2::Event::Bail, straight out of the Perl Programmers Reference Guide, and honestly? it's giving "emergency brake" energy and we're obsessed πŸ›‘βœ¨


πŸŽ€ NAME πŸŽ€

Test2::Event::Bail β€” Bailout! like literally, that's the whole name, no cap πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: the bailout event gets generated when things go horribly wrong and you need to halt all testing in the current file 😭 like, not "oops one test failed" β€” this is the "we're shutting the whole thing down, bestie" event πŸ”₯

it's the main character of disaster events, fr fr πŸ‘‘


✨ SYNOPSIS ✨

use Test2::API qw/context/;
use Test2::Event::Bail;

my $ctx = context();
my $event = $ctx->bail('Stuff is broken');

see how easy that is? grab a context, call bail with your reason, and let the event do its thing πŸ’…


🌸 METHODS 🌸

this one inherits from Test2::Event (yes, it's a whole nepo-baby situation and we love that for it πŸ’œ). on top of all that, it also defines:

  • $reason = $e->reason β€” this hands you back the reason for the bailout, so you can be like "okay but why did everything fall apart" and it'll actually tell you 🫢

⭐ SOURCE ⭐

the source code repository for Test2 lives right here, go be nosy, it's iconic:

<https://github.com/Test-More/test-more/>


πŸ‘‘ MAINTAINERS πŸ‘‘

Chad Granum <exodist@cpan.org>


🌈 AUTHORS 🌈

Chad Granum <exodist@cpan.org>


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/>


aaaand that's the whole page, bestie πŸ§šπŸ’– thanks for reading, you ate that. this cutie was brought to you by perl v5.42.3, dated 2026-11-03, and it's still out here being Test2::Event::Bail(3pm) β€” periodt πŸ’…βœ¨

πŸ“¦ where this page comes from