line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
############################################################################# |
3
|
|
|
|
|
|
|
## $Id: Exceptions.pm 13304 2009-09-11 13:49:39Z spadkins $ |
4
|
|
|
|
|
|
|
############################################################################# |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package App::Exceptions; |
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
48
|
use strict; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
309
|
|
9
|
8
|
|
|
8
|
|
44
|
use vars qw($VERSION); |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
1418
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$VERSION = (q$Revision: 13304 $ =~ /(\d[\d\.]*)/)[0]; # VERSION numbers generated by svn |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my %e; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
BEGIN { |
16
|
8
|
|
|
8
|
|
358
|
%e = ( |
17
|
|
|
|
|
|
|
'App::Exception' => { |
18
|
|
|
|
|
|
|
description => 'An exception in a core App-Context class.', |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
'App::Exception::Context' => { |
22
|
|
|
|
|
|
|
description => 'An exception in the Context service.', |
23
|
|
|
|
|
|
|
isa => 'App::Exception', |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
'App::Exception::Conf' => { |
27
|
|
|
|
|
|
|
description => 'An exception in the Conf service.', |
28
|
|
|
|
|
|
|
isa => 'App::Exception', |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
'App::Exception::Serializer' => { |
32
|
|
|
|
|
|
|
description => 'An exception in the Serializer service.', |
33
|
|
|
|
|
|
|
isa => 'App::Exception', |
34
|
|
|
|
|
|
|
}, |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
'App::Exception::Security' => { |
37
|
|
|
|
|
|
|
description => 'An exception in the Security service.', |
38
|
|
|
|
|
|
|
isa => 'App::Exception', |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
'App::Exception::Session' => { |
42
|
|
|
|
|
|
|
description => 'An exception in the Session service.', |
43
|
|
|
|
|
|
|
isa => 'App::Exception', |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
'App::Exception::Procedure' => { |
47
|
|
|
|
|
|
|
description => 'An exception in the Procedure service.', |
48
|
|
|
|
|
|
|
isa => 'App::Exception', |
49
|
|
|
|
|
|
|
}, |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
'App::Exception::Messaging' => { |
52
|
|
|
|
|
|
|
description => 'An exception in the Messaging service.', |
53
|
|
|
|
|
|
|
isa => 'App::Exception', |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
'App::Exception::LogChannel' => { |
57
|
|
|
|
|
|
|
description => 'An exception in the LogChannel service.', |
58
|
|
|
|
|
|
|
isa => 'App::Exception', |
59
|
|
|
|
|
|
|
}, |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
8
|
|
|
8
|
|
54
|
use Exception::Class (%e); |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
85
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 NAME |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
App::Exceptions - Creates all exception classes used in App. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 SYNOPSIS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
use App::Exceptions; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 DESCRIPTION |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Using this class creates all the exceptions classes used by App |
79
|
|
|
|
|
|
|
(via the Exception::Class class). |
80
|
|
|
|
|
|
|
Stacktrace generation is turned on for all the exception classes. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
See Exception::Class on CPAN for more information on |
83
|
|
|
|
|
|
|
how this is done. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Note that there is really only one general |
86
|
|
|
|
|
|
|
exception class defined for each App-Context Service. |
87
|
|
|
|
|
|
|
Within each Service, there may be a separate |
88
|
|
|
|
|
|
|
exception hierarchy which is more fine-grained. However, each |
89
|
|
|
|
|
|
|
service is responsible to (1) handle these exceptions, |
90
|
|
|
|
|
|
|
(2) handle these exceptions and rethrow |
91
|
|
|
|
|
|
|
the general exception defined for the service, or |
92
|
|
|
|
|
|
|
(3) derive all of the exceptions from the general exception. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 EXCEPTION CLASSES |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=over |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * App::Exception |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This is the base class for all exceptions generated within App (all |
101
|
|
|
|
|
|
|
exceptions should return true for C<$@-Eisa('App::Exception')> |
102
|
|
|
|
|
|
|
except those that are generated via internal Perl errors). |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * App::Exception::Context |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Base class for all Context-related exceptions. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * App::Exception::Conf |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Base class for all Conf-related exceptions. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item * App::Exception::Serializer |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Base class for all Serializer-related exceptions. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item * App::Exception::Security |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Base class for all Security-related exceptions. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * App::Exception::Session |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Base class for all Session-related exceptions. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item * App::Exception::Procedure |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Base class for all Procedure-related exceptions. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * App::Exception::Messaging |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Base class for all Messaging-related exceptions. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * App::Exception::LogChannel |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Base class for all LogChannel-related exceptions. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=back |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
* Author: Stephen Adkins |
141
|
|
|
|
|
|
|
* Adapted from Dave Rolsky's Alzabo::Exceptions |
142
|
|
|
|
|
|
|
* License: This is free software. It is licensed under the same terms as Perl itself. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut |
145
|
|
|
|
|
|
|
|