1 package Test2::EventFacet::Error;
5 our $VERSION = '1.302111';
7 sub facet_key { 'errors' }
10 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
11 use Test2::Util::HashBase qw{ -tag -fail };
23 Test2::EventFacet::Error - Facet for errors that need to be shown.
27 This facet is used when an event needs to convey errors.
31 This facet has the hash key C<'errors'>, and is a list of facets instead of a
38 =item $string = $error->{details}
40 =item $string = $error->details()
42 Explanation of the error, or the error itself (such as an exception). In perl
43 exceptions may be blessed objects, so this field may contain a blessed object.
45 =item $short_string = $error->{tag}
47 =item $short_string = $error->tag()
49 Short tag to categorize the error. This is usually 10 characters or less,
50 formatters may truncate longer tags.
52 =item $bool = $error->{fail}
54 =item $bool = $error->fail()
56 Not all errors are fatal, some are displayed having already been handled. Set
57 this to true if you want the error to cause the test to fail. Without this the
58 error is simply a diagnostics message that has no effect on the overall
65 The source code repository for Test2 can be found at
66 F<http://github.com/Test-More/test-more/>.
72 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
80 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
86 Copyright 2016 Chad Granum E<lt>exodist@cpan.orgE<gt>.
88 This program is free software; you can redistribute it and/or
89 modify it under the same terms as Perl itself.
91 See F<http://dev.perl.org/licenses/>