| Eidolon documentation | view source | Contained in the Eidolon distribution. |
Eidolon::Core::Exception - base exception class for Eidolon.
General exception usage example:
eval
{
# ...
throw CoreError::Compile("Oops!");
# ...
};
if ($@)
{
my $e = $@;
if ($e eq "CoreError::Compile")
{
print $e; # prints "Oops!"
}
else
{
$e->rethrow;
}
}
The Eidolon::Core::Exception class is a base class for all core, driver and application exceptions. It contains various methods that can be useful for exception handling. This package is a rework of CPAN Exception package.
Class constructor. Creates an exception object and calls class initialization
function. Don't raise exceptions using this method, use throw() instead.
Throws exception. Actually, creates an Eidolon::Core::Exception object and dies.
Rethrows the exception (if it was thrown before).
Overloaded equality comparsion operator (==). Checks if exception is the
instance of $class specified.
Overloaded stringify operation. Returns exception message.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Anton Belousov, <abel@cpan.org>
Copyright (c) 2009, Atma 7, http://www.atma7.com
| Eidolon documentation | view source | Contained in the Eidolon distribution. |