| 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 | 7 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 7 | ▶ | use warnings::register; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | 7 | our $VERSION = (split(/ /, ' $Revision: 1.3 $ '))[2]; | |||||||||
| 22 | 7 | our @EXPORT = qw( eTemplateError eTemplateNotFound ); | |||||||||
| 23 | |||||||||||
| 24 | 7 | ▶ | use base qw( Exporter OpenFrame::WebApp::Error ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | 7 | ▶ | use constant eTemplateError => 'error.template.process'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 7 | ▶ | use constant eTemplateNotFound => 'error.template.not.found'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | |||||||||||
| 29 | 3 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | 3 | my $class = shift; | |||||||||
| 31 | 3 | local $Error::Depth = $Error::Depth + 1; | |||||||||
| 32 | 3 | ▶ | $class->SUPER::new(map { /^((?:message)|(?:template))$/ ? "-$1" : $_; } @_); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 3 | ▶ | sub message { | ||||||||
|
Subroutine
message: called CC=2 SCAR=8.4
Pod
documented
| |||||||||||
| 36 | 3 | my $self = shift; | |||||||||
| 37 | 3 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 0 | $self->{-message} = shift; | |||||||||
| 39 | 0 | return $self; | |||||||||
| 40 | } else { | ||||||||||
| 41 | 3 | return $self->{-message}; | |||||||||
| 42 | } | ||||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 2 | ▶ | sub template { | ||||||||
|
Subroutine
template: called CC=2 SCAR=8.4
Pod
documented
| |||||||||||
| 46 | 2 | my $self = shift; | |||||||||
| 47 | 2 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 0 | $self->{-template} = shift; | |||||||||
| 49 | 0 | return $self; | |||||||||
| 50 | } else { | ||||||||||
| 51 | 2 | return $self->{-template}; | |||||||||
| 52 | } | ||||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | 7 | 1; | |||||||||
| 57 | |||||||||||
| 58 | |||||||||||
| 59 | __END__ | ||||||||||