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

Eve::Error::Base
Eve::Error::Attribute
Eve::Error::HttpDispatcher
Eve::Error::NotImplemented
Eve::Error::Program
Eve::Error::Session
Eve::Error::Template
Eve::Error::Value
Eve::Exception::Base
Eve::Exception::Data
Eve::Exception::Die
Eve::Exception::Duplicate
Eve::Exception::Http
Eve::Exception::Http::400BadRequest
Eve::Exception::Http::401Unauthorized
Eve::Exception::Http::404NotFound
Eve::Exception::Http::403Forbidden
Eve::Exception::Http::405MethodNotAllowed
Eve::Exception::InputOutput
Eve::Exception::Privilege

SEE ALSO

Exception::Class

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.

AUTHOR

Sergey Konoplev