line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Lazy::ErrorHandler; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2059
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use CGI::Lazy::Globals; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1335
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
8
|
|
|
|
|
|
|
sub badConfig { |
9
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
10
|
0
|
|
|
|
|
0
|
my $filename = shift; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
0
|
my $msg = "Couldn't parse config file $filename: $@\n"; |
13
|
|
|
|
|
|
|
|
14
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
0
|
return; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
22
|
|
|
|
|
|
|
sub badSession { |
23
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
24
|
0
|
|
|
|
|
0
|
my $id = shift; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
my $msg = "Bad Session ID : $id\n"; |
27
|
|
|
|
|
|
|
|
28
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
0
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
36
|
|
|
|
|
|
|
sub badSessionExpiry { |
37
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
0
|
my $msg = "Bad Session Config. Please check your config file or hash in the Session->{expires} key.\n"; |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
0
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
49
|
|
|
|
|
|
|
sub config { |
50
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
0
|
return $self->q->config; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
57
|
|
|
|
|
|
|
sub couldntOpenDebugFile { |
58
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
59
|
0
|
|
|
|
|
0
|
my $filename = shift; |
60
|
0
|
|
|
|
|
0
|
my $error = shift; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
0
|
my $msg = "Couldn't open Debugging Log file /tmp/$filename: $error\n"; |
63
|
|
|
|
|
|
|
|
64
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
0
|
return; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
72
|
|
|
|
|
|
|
sub couldntOpenCssFile { |
73
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
74
|
0
|
|
|
|
|
0
|
my $docroot = shift; |
75
|
0
|
|
|
|
|
0
|
my $cssdir = shift; |
76
|
0
|
|
|
|
|
0
|
my $file = shift; |
77
|
0
|
|
|
|
|
0
|
my $error = shift; |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
0
|
my $msg = "Couldn't open CSS file $docroot$cssdir/$file: $error\n"; |
80
|
|
|
|
|
|
|
|
81
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
82
|
|
|
|
|
|
|
|
83
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
0
|
return; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
89
|
|
|
|
|
|
|
sub couldntOpenJsFile { |
90
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
91
|
0
|
|
|
|
|
0
|
my $docroot = shift; |
92
|
0
|
|
|
|
|
0
|
my $jsdir = shift; |
93
|
0
|
|
|
|
|
0
|
my $file = shift; |
94
|
0
|
|
|
|
|
0
|
my $error = shift; |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
0
|
my $msg = "Couldn't open JS file $docroot$jsdir/$file: $error\n"; |
97
|
|
|
|
|
|
|
|
98
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
0
|
return; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
106
|
|
|
|
|
|
|
sub dbConnectFailed { |
107
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
0
|
my $msg = "Database connection failed: $@\n"; |
110
|
|
|
|
|
|
|
|
111
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
112
|
|
|
|
|
|
|
|
113
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
0
|
return; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
119
|
|
|
|
|
|
|
sub dbError { |
120
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
121
|
0
|
|
|
|
|
0
|
my $pkg = shift; |
122
|
0
|
|
|
|
|
0
|
my $file = shift; |
123
|
0
|
|
|
|
|
0
|
my $line = shift; |
124
|
0
|
|
|
|
|
0
|
my $query = shift; |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
0
|
my $msg = "Database operation failed in $file calling $pkg at line $line :$@\ncalling: $query\n"; |
127
|
|
|
|
|
|
|
|
128
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
|
|
0
|
return; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
136
|
|
|
|
|
|
|
sub dbReturnedMoreThanSingleValue { |
137
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
138
|
|
|
|
|
|
|
|
139
|
0
|
|
|
|
|
0
|
my ($pkg, $file, $line) = caller; |
140
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
0
|
my $msg = "Database lookup return more than a single value in $pkg called by $file at line $line\n"; |
142
|
|
|
|
|
|
|
|
143
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
146
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
0
|
return; |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
151
|
|
|
|
|
|
|
sub errorref { |
152
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
0
|
return $self->{_errors}; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
158
|
|
|
|
|
|
|
sub errors { |
159
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
160
|
|
|
|
|
|
|
|
161
|
0
|
|
|
|
|
0
|
return @{$self->{_errors}}; |
|
0
|
|
|
|
|
0
|
|
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
165
|
|
|
|
|
|
|
sub getWithOtherThanArray { |
166
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
167
|
|
|
|
|
|
|
|
168
|
0
|
|
|
|
|
0
|
my ($pkg, $file, $line) = caller; |
169
|
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
0
|
my $msg = "DB get (get, getarray, gethashlist) called with something other than an array reference in $pkg called by $file at line $line. That won't fly.\n"; |
171
|
|
|
|
|
|
|
|
172
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
173
|
|
|
|
|
|
|
|
174
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
0
|
return; |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
180
|
|
|
|
|
|
|
sub noConfig { |
181
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
182
|
0
|
|
|
|
|
0
|
my $filename = shift; |
183
|
|
|
|
|
|
|
|
184
|
0
|
|
|
|
|
0
|
my $msg = "Couldn't open config file $filename : $@\n"; |
185
|
|
|
|
|
|
|
|
186
|
0
|
0
|
|
|
|
0
|
print STDERR $msg unless $self->silent; |
187
|
|
|
|
|
|
|
|
188
|
0
|
|
|
|
|
0
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
0
|
|
189
|
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
0
|
return; |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
194
|
|
|
|
|
|
|
sub new { |
195
|
1
|
|
|
1
|
0
|
4
|
my $class = shift; |
196
|
1
|
|
|
|
|
3
|
my $q = shift; |
197
|
|
|
|
|
|
|
|
198
|
1
|
|
|
|
|
7
|
my $self = { |
199
|
|
|
|
|
|
|
_q => $q, |
200
|
|
|
|
|
|
|
_errors => [], |
201
|
|
|
|
|
|
|
_silent => $q->vars->{silent}, |
202
|
|
|
|
|
|
|
}; |
203
|
|
|
|
|
|
|
|
204
|
1
|
|
|
|
|
3
|
bless $self, $class; |
205
|
|
|
|
|
|
|
|
206
|
1
|
|
|
|
|
7
|
return $self; |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
210
|
|
|
|
|
|
|
sub q { |
211
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
212
|
|
|
|
|
|
|
|
213
|
0
|
|
|
|
|
|
return $self->{_q}; |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
217
|
|
|
|
|
|
|
sub tmplCreateError { |
218
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
219
|
|
|
|
|
|
|
|
220
|
0
|
|
|
|
|
|
my $msg = "Template Creation Error: $@\n"; |
221
|
|
|
|
|
|
|
|
222
|
0
|
0
|
|
|
|
|
print STDERR $msg unless $self->silent; |
223
|
|
|
|
|
|
|
|
224
|
0
|
|
|
|
|
|
push @{$self->{_errors}}, $msg ; |
|
0
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
|
226
|
0
|
|
|
|
|
|
return; |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
230
|
|
|
|
|
|
|
sub silent { |
231
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
232
|
|
|
|
|
|
|
|
233
|
0
|
|
|
|
|
|
return $self->{_silent}; |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
237
|
|
|
|
|
|
|
sub tmplParamError { |
238
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
239
|
0
|
|
|
|
|
|
my $template = shift; |
240
|
|
|
|
|
|
|
|
241
|
0
|
|
|
|
|
|
my $msg = "Template Parameter Error in $template: $@\n"; |
242
|
|
|
|
|
|
|
|
243
|
0
|
0
|
|
|
|
|
print STDERR $msg unless $self->silent; |
244
|
|
|
|
|
|
|
|
245
|
0
|
|
|
|
|
|
push @{$self->{_errors}}, $msg; |
|
0
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
|
247
|
0
|
|
|
|
|
|
return; |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
1 |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
__END__ |