This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
6425568b771f0c29c87eaeba7095db8e5eb248d5
[perl5.git] / cpan / Test-Simple / lib / Test2 / EventFacet / Error.pm
1 package Test2::EventFacet::Error;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.302120';
6
7 sub facet_key { 'errors' }
8 sub is_list { 1 }
9
10 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
11 use Test2::Util::HashBase qw{ -tag -fail };
12
13 1;
14
15 __END__
16
17 =pod
18
19 =encoding UTF-8
20
21 =head1 NAME
22
23 Test2::EventFacet::Error - Facet for errors that need to be shown.
24
25 =head1 DESCRIPTION
26
27 This facet is used when an event needs to convey errors.
28
29 =head1 NOTES
30
31 This facet has the hash key C<'errors'>, and is a list of facets instead of a
32 single item.
33
34 =head1 FIELDS
35
36 =over 4
37
38 =item $string = $error->{details}
39
40 =item $string = $error->details()
41
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.
44
45 =item $short_string = $error->{tag}
46
47 =item $short_string = $error->tag()
48
49 Short tag to categorize the error. This is usually 10 characters or less,
50 formatters may truncate longer tags.
51
52 =item $bool = $error->{fail}
53
54 =item $bool = $error->fail()
55
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
59 pass/fail result.
60
61 =back
62
63 =head1 SOURCE
64
65 The source code repository for Test2 can be found at
66 F<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
86 Copyright 2016 Chad Granum E<lt>exodist@cpan.orgE<gt>.
87
88 This program is free software; you can redistribute it and/or
89 modify it under the same terms as Perl itself.
90
91 See F<http://dev.perl.org/licenses/>
92
93 =cut