Eve::Exception - a module that defines a set of exception classes.
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.
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
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.
To install Eve, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Eve
CPAN shell
perl -MCPAN -e shell install Eve
For more information on module installation, please visit the detailed CPAN module installation guide.