NAME
Eve::Exception - a module that defines a set of exception classes.
SYNOPSIS
To throw an exception:
use Eve::Exception;
Eve::Exception::Base->throw(message => 'Something bad happened.');
To catch an exception:
use Eve::Exception;
eval {
# Code that throws an exception here
something();
};
my $e;
if ($e = Eve::Exception::Data->caught()) {
# Do the thing
} elsif ($e = Eve::Exception::Http->caught()) {
# Do something else
} elsif ($e = Exception::Class::Base->caught()) {
$e->rethrow();
}
It is conventional to catch Eve::Exception derivatives only. Eve::Error derivatives are assumed to be uncatchable.
DESCRIPTION
Provided classes
SEE ALSO
LICENSE AND COPYRIGHT
Copyright 2012 Igor Zinovyev.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.