Test2::Event::Exception(3perl)

Test2::Event::Exception3perl

Exception event

Usage

    use Test2::API qw/context/;
    use Test2::Event::Exception;
    my $ctx = context();
    my $event = $ctx->send_event('Exception', error => 'Stuff is broken');

Overview

An exception event will display to STDERR, and will prevent the overall test file from passing.

Methods

Inherits from Test2::Event. Also defines:

$reason = $e->error

The reason for the exception.

Caveats

Be aware that all exceptions are stringified during construction.

Source

The source code repository for Test2 can be found at <https://github.com/Test-More/test-more/>.

Maintainers

Chad Granum <[email protected]>

Releases

5 releases since Debian 10 (Buster); the text changed 4 times.

  1. 10
  2. 11
  3. 12
  4. 13
  5. Arch

Authors

Chad Granum <[email protected]>

From perl 5.44.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.