1 package Test2::Event::Exception;
5 our $VERSION = '1.302166';
8 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
9 use Test2::Util::HashBase qw{error};
13 $self->{+ERROR} = "$self->{+ERROR}";
20 chomp(my $msg = "Exception: " . $self->{+ERROR});
28 my $out = $self->common_facet_data;
34 details => $self->{+ERROR},
52 Test2::Event::Exception - Exception event
56 An exception event will display to STDERR, and will prevent the overall test
61 use Test2::API qw/context/;
62 use Test2::Event::Exception;
65 my $event = $ctx->send_event('Exception', error => 'Stuff is broken');
69 Inherits from L<Test2::Event>. Also defines:
73 =item $reason = $e->error
75 The reason for the exception.
81 Be aware that all exceptions are stringified during construction.
85 The source code repository for Test2 can be found at
86 F<http://github.com/Test-More/test-more/>.
92 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
100 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
106 Copyright 2019 Chad Granum E<lt>exodist@cpan.orgE<gt>.
108 This program is free software; you can redistribute it and/or
109 modify it under the same terms as Perl itself.
111 See F<http://dev.perl.org/licenses/>