1Test2::Event::ExceptionU(s3e)r Contributed Perl DocumentaTteisotn2::Event::Exception(3)
2
3
4
6 Test2::Event::Exception - Exception event
7
9 An exception event will display to STDERR, and will prevent the overall
10 test file from passing.
11
13 use Test2::API qw/context/;
14 use Test2::Event::Exception;
15
16 my $ctx = context();
17 my $event = $ctx->send_event('Exception', error => 'Stuff is broken');
18
20 Inherits from Test2::Event. Also defines:
21
22 $reason = $e->error
23 The reason for the exception.
24
26 Be aware that all exceptions are stringified during construction.
27
29 The source code repository for Test2 can be found at
30 http://github.com/Test-More/test-more/.
31
33 Chad Granum <exodist@cpan.org>
34
36 Chad Granum <exodist@cpan.org>
37
39 Copyright 2020 Chad Granum <exodist@cpan.org>.
40
41 This program is free software; you can redistribute it and/or modify it
42 under the same terms as Perl itself.
43
44 See http://dev.perl.org/licenses/
45
46
47
48perl v5.34.0 2021-09-29 Test2::Event::Exception(3)