OpenFrame::WebApp::Template::Error - Template errors


OpenFrame-WebApp documentation Contained in the OpenFrame-WebApp distribution.

Index


Code Index:

NAME

Top

OpenFrame::WebApp::Template::Error - Template errors

SYNOPSIS

Top

  use OpenFrame::WebApp::Template::Error;
  throw OpenFrame::WebApp::Template::Error( flag     => eTemplateError,
                                            message  => $text,
                                            template => $file );

DESCRIPTION

Top

Template Error class. Inherits interface from OpenFrame::WebApp::Error.

EXPORTED FLAGS

Top

 eTemplateError
 eTemplateNotFound

METHODS

Top

message

set/get error message emitted by the template processing engine (if any).

template

set/get template file associated with this error (if any).

AUTHOR

Top

Steve Purkis <spurkis@quiup.com>

COPYRIGHT

Top

SEE ALSO

Top

OpenFrame::WebApp::Error, OpenFrame::WebApp::Template


OpenFrame-WebApp documentation Contained in the OpenFrame-WebApp distribution.

package OpenFrame::WebApp::Template::Error;

use utf8;
use strict;
use warnings::register;

our $VERSION = (split(/ /, ' $Revision: 1.3 $ '))[2];
our @EXPORT  = qw( eTemplateError eTemplateNotFound );

use base qw( Exporter OpenFrame::WebApp::Error );

use constant eTemplateError    => 'error.template.process';
use constant eTemplateNotFound => 'error.template.not.found';

sub new {
    my $class = shift;
    local $Error::Depth = $Error::Depth + 1;
    $class->SUPER::new(map { /^((?:message)|(?:template))$/ ? "-$1" : $_; } @_);
}

sub message {
    my $self = shift;
    if (@_) {
	$self->{-message} = shift;
	return $self;
    } else {
	return $self->{-message};
    }
}

sub template {
    my $self = shift;
    if (@_) {
	$self->{-template} = shift;
	return $self;
    } else {
	return $self->{-template};
    }
}


1;


__END__

#------------------------------------------------------------------------------