OpenFrame::WebApp::Error - base class for WebApp Errors.
# meant to be sub-classed: use OpenFrame::WebApp::Error::SomeClass; # should export some error flags to your namespace use Error qw( :try ); try { throw OpenFrame::WebApp::Error::SomeClass( flag => eSomeError ); } catch OpenFrame::WebApp::Error::SomeClass with { my $e = shift; do { ... } if ($e->flag == eSomeError); }
This is the base class for Error exceptions in OpenFrame-WebApp. It introduces an error flag to the Error module in an attempt to make localization easier.
Error
Descriptive error flags should be exported from each subclass:
use base qw( Exporter OpenFrame::WebApp::Error ); our @EXPORT = qw( eSomethingBad ); use constant eSomethingBad => 'something.bad';
The value of these constants can then be used as localization keys with the likes of Locale::Gettext or Locale::Maketext.
Locale::Gettext
Locale::Maketext
new recognizes '-flag' as a synonym for '-text'. The '-' is optional:
new
throw Some::Error( flag => eSomethingBad );
set/get the error flag.
Steve Purkis <spurkis@epn.nu>
Copyright (c) 2003 Steve Purkis. All rights reserved. Released under the same license as Perl itself.
Error, OpenFrame::WebApp
To install OpenFrame::WebApp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenFrame::WebApp
CPAN shell
perl -MCPAN -e shell install OpenFrame::WebApp
For more information on module installation, please visit the detailed CPAN module installation guide.