line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Exception::Interface; |
2
|
|
|
|
|
|
|
|
3
|
181
|
|
|
181
|
|
108936
|
use Moose::Role; |
|
181
|
|
|
|
|
562
|
|
|
181
|
|
|
|
|
1680
|
|
4
|
181
|
|
|
181
|
|
938530
|
use namespace::clean -except => 'meta'; |
|
181
|
|
|
|
|
1805
|
|
|
181
|
|
|
|
|
2721
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use overload |
7
|
236
|
|
|
236
|
|
5791
|
q{""} => sub { $_[0]->as_string }, |
8
|
181
|
|
|
181
|
|
71444
|
fallback => 1; |
|
181
|
|
|
|
|
534
|
|
|
181
|
|
|
|
|
2685
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires qw/as_string throw rethrow/; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
__END__ |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Catalyst::Exception::Interface - Role defining the interface for Catalyst exceptions |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package My::Catalyst::Like::Exception; |
23
|
|
|
|
|
|
|
use Moose; |
24
|
|
|
|
|
|
|
use namespace::clean -except => 'meta'; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
with 'Catalyst::Exception::Interface'; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# This comprises the required interface. |
29
|
|
|
|
|
|
|
sub as_string { 'the exception text for stringification' } |
30
|
|
|
|
|
|
|
sub throw { shift; die @_ } |
31
|
|
|
|
|
|
|
sub rethrow { shift; die @_ } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This is a role for the required interface for Catalyst exceptions. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
It ensures that all exceptions follow the expected interface, |
38
|
|
|
|
|
|
|
and adds overloading for stringification when composed onto a |
39
|
|
|
|
|
|
|
class. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 REQUIRED METHODS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 as_string |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 throw |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 rethrow |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 METHODS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 meta |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Provided by Moose |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SEE ALSO |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=over 4 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item L<Catalyst> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item L<Catalyst::Exception> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=back |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AUTHORS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Catalyst Contributors, see Catalyst.pm |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 COPYRIGHT |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This library is free software. You can redistribute it and/or modify |
72
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |