1package Test2::EventFacet::Error;
2use strict;
3use warnings;
4
5our $VERSION = '1.302175';
6
7sub facet_key { 'errors' }
8sub is_list { 1 }
9
10BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
11use Test2::Util::HashBase qw{ -tag -fail };
12
131;
14
15__END__
16
17=pod
18
19=encoding UTF-8
20
21=head1 NAME
22
23Test2::EventFacet::Error - Facet for errors that need to be shown.
24
25=head1 DESCRIPTION
26
27This facet is used when an event needs to convey errors.
28
29=head1 NOTES
30
31This facet has the hash key C<'errors'>, and is a list of facets instead of a
32single item.
33
34=head1 FIELDS
35
36=over 4
37
38=item $string = $error->{details}
39
40=item $string = $error->details()
41
42Explanation of the error, or the error itself (such as an exception). In perl
43exceptions may be blessed objects, so this field may contain a blessed object.
44
45=item $short_string = $error->{tag}
46
47=item $short_string = $error->tag()
48
49Short tag to categorize the error. This is usually 10 characters or less,
50formatters may truncate longer tags.
51
52=item $bool = $error->{fail}
53
54=item $bool = $error->fail()
55
56Not all errors are fatal, some are displayed having already been handled. Set
57this to true if you want the error to cause the test to fail. Without this the
58error is simply a diagnostics message that has no effect on the overall
59pass/fail result.
60
61=back
62
63=head1 SOURCE
64
65The source code repository for Test2 can be found at
66F<http://github.com/Test-More/test-more/>.
67
68=head1 MAINTAINERS
69
70=over 4
71
72=item Chad Granum E<lt>exodist@cpan.orgE<gt>
73
74=back
75
76=head1 AUTHORS
77
78=over 4
79
80=item Chad Granum E<lt>exodist@cpan.orgE<gt>
81
82=back
83
84=head1 COPYRIGHT
85
86Copyright 2019 Chad Granum E<lt>exodist@cpan.orgE<gt>.
87
88This program is free software; you can redistribute it and/or
89modify it under the same terms as Perl itself.
90
91See F<http://dev.perl.org/licenses/>
92
93=cut
94