line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Able::FatalException; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
698
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
use overload |
5
|
3
|
|
|
3
|
|
243
|
'""' => sub { return shift->message; }, |
6
|
1
|
|
|
1
|
|
5067
|
fallback => 1; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
7
|
1
|
|
|
1
|
|
63
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
8
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
147
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Test::Able::FatalException - Fatal Exception Class |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Test::Able::FatalException->throw->( 'get me outta here - for real!' ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Test::Able has special exception handling for the test-related methods. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
This exception class is a means for breaking out of Test::Able's exception |
23
|
|
|
|
|
|
|
smothering. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
See L<Test::Able::Role::Meta::Class/on_method_exception> and |
26
|
|
|
|
|
|
|
L<Test::Able::Role::Meta::Class/method_exceptions> for details. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=over |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item message |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
The text of the exception. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=back |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has 'message' => ( is => 'rw', isa => 'Str', default => '', ); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 METHODS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=over |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item BUILDARGS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Standard Moose BUILDARGS method to allow single parameter construction. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub BUILDARGS { |
53
|
1
|
|
|
1
|
1
|
10
|
my $class = shift; |
54
|
|
|
|
|
|
|
|
55
|
1
|
50
|
|
|
|
5
|
if ( @_ == 1 ) { |
56
|
1
|
|
|
|
|
4
|
return { message => $_[ 0 ], }; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
else { |
59
|
0
|
|
|
|
|
0
|
return { @_ }; |
60
|
|
|
|
|
|
|
}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item throw |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Main method used to construct and throw an exception object. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=back |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub throw { |
72
|
1
|
|
|
1
|
1
|
10
|
my $class = shift; |
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
|
|
13
|
die $class->new( @_, ); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 AUTHOR |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Justin DeVuyst, C<justin@devuyst.com> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Copyright 2009 by Justin DeVuyst. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
86
|
|
|
|
|
|
|
the same terms as Perl itself. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |