TEST2::EVENT::EXCEPTION(3pm)

πŸ’– NAME πŸ’–

Test2::Event::Exception β€” Exception event πŸ’…

Okay so this page is Test2::...xception(3pm) from the Perl Programmers Reference Guide β€” aka the docs for the Exception event, bestie.

🌸 DESCRIPTION 🌸

An exception event will display to STDERR, and it will prevent the overall test file from passing. That's the whole vibe: exception event = not passing, periodt. 😭

✨ SYNOPSIS ✨

Tiny code moment, no cap:

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

my $ctx = context();
my $event = $ctx->send_event('Exception', error => 'Stuff is broken');

πŸŽ€ METHODS πŸŽ€

Inherits from Test2::Event. Also defines:

  • $reason = $e->error β€” the reason for the exception. That's it, that's the method, and it's iconic. πŸ’–

πŸ¦‹ CAVEATS πŸ¦‹

Heads up, bestie: be aware that all exceptions are stringified during construction. Not me warning you for no reason β€” that's the caveat, fr fr. ⚠️

🌈 SOURCE 🌈

The source code repository for Test2 can be found at <https://github.com/Test-More/test-more/>. Go browse, it's giving open source excellence. 🌟

πŸ‘‘ MAINTAINERS πŸ‘‘

Chad Granum <exodist@cpan.org> β€” maintaining the vibes. 🫢

πŸ’œ AUTHORS πŸ’œ

Chad Granum <exodist@cpan.org> β€” authoring the vibes. ✨

Legal bits, bestie β€” keep them intact:

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


Bye bestie 🫢 this page is from perl v5.42.3, dated 2026-11-03, and the footer calls it Test2::...xception(3pm). Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from