line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
OpenFrame::WebApp::Template::Error - Template errors |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use OpenFrame::WebApp::Template::Error; |
8
|
|
|
|
|
|
|
throw OpenFrame::WebApp::Template::Error( flag => eTemplateError, |
9
|
|
|
|
|
|
|
message => $text, |
10
|
|
|
|
|
|
|
template => $file ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package OpenFrame::WebApp::Template::Error; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
3958
|
use utf8; |
|
2
|
|
|
|
|
20
|
|
|
2
|
|
|
|
|
11
|
|
18
|
2
|
|
|
2
|
|
60
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
54
|
|
19
|
2
|
|
|
2
|
|
33
|
use warnings::register; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
327
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $VERSION = (split(/ /, ' $Revision: 1.3 $ '))[2]; |
22
|
|
|
|
|
|
|
our @EXPORT = qw( eTemplateError eTemplateNotFound ); |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
2
|
|
11
|
use base qw( Exporter OpenFrame::WebApp::Error ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1170
|
|
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
2
|
|
9
|
use constant eTemplateError => 'error.template.process'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
144
|
|
27
|
2
|
|
|
2
|
|
9
|
use constant eTemplateNotFound => 'error.template.not.found'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
472
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub new { |
30
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
31
|
0
|
|
|
|
|
|
local $Error::Depth = $Error::Depth + 1; |
32
|
0
|
0
|
|
|
|
|
$class->SUPER::new(map { /^((?:message)|(?:template))$/ ? "-$1" : $_; } @_); |
|
0
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub message { |
36
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
37
|
0
|
0
|
|
|
|
|
if (@_) { |
38
|
0
|
|
|
|
|
|
$self->{-message} = shift; |
39
|
0
|
|
|
|
|
|
return $self; |
40
|
|
|
|
|
|
|
} else { |
41
|
0
|
|
|
|
|
|
return $self->{-message}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub template { |
46
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
47
|
0
|
0
|
|
|
|
|
if (@_) { |
48
|
0
|
|
|
|
|
|
$self->{-template} = shift; |
49
|
0
|
|
|
|
|
|
return $self; |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
|
return $self->{-template}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |