NAME
Handel::Exception - Exceptions used within Handel
VERSION
$Id: Exception.pm 148 2005-02-08 23:30:09Z claco $
SYNOPSIS
use Handel::Cart;
use Handel::Exception' qw(:try);
try {
my $cart = Handel::Cart->new('junk crap');
} catch Handel::Exception::Argument with {
print 'Passed the wrong arguments to method';
} catch Handel::Exception with {
print 'Unknown issue with Handel';
} catch Error with {
print 'Unhandled exception';
} otherwise {
print 'aliens ate my exception';
};
DESCRIPTION
Handel::Exception
subclasses Error and attempts to throw exceptions when unexpected things happen.
EXCEPTIONS
Handel::Exception
This is the base exception thrown in Handel
. All other exceptions subclass Handel::Exception
so it's possibly to catch all Handel generated exceptions with a single catch
statement.
try {
...
} catch Handel::Exception with {
my $E = shift;
print 'Something bad happened in Handel: ' . E->text;
} catch MyApplicaitonException with {
print 'Something bad happened in MyApplication';
};
See Error for more information on how to use exceptions.
Handel::Exception::Constraint
This exception is thrown if a database constraint is violated. This is true for both raw DBI database constraint errors as well as field updates that don't pass constraints in Handel::Constraints
.
Handel::Exception::Argument
This exception is thrown when an invalid or unexpected argument value is passed into methods.
SEE ALSO
AUTHOR
Christopher H. Laco
CPAN ID: CLACO
cpan@chrislaco.com
http://today.icantfocus.com/blog/