Anton Belousov > Eidolon > Eidolon::Core::Exception

Download:
Eidolon-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Eidolon::Core::Exception - base exception class for Eidolon.

SYNOPSIS ^

General exception usage example:

    eval
    {
        # ...
        
        throw CoreError::Compile("Oops!");

        # ...
    };

    if ($@)
    {
        my $e = $@;

        if ($e eq "CoreError::Compile")
        {
            print $e; # prints "Oops!"
        }
        else
        {
            $e->rethrow;
        }
    }

DESCRIPTION ^

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.

METHODS ^

new($message)

Class constructor. Creates an exception object and calls class initialization function. Don't raise exceptions using this method, use throw() instead.

throw()

Throws exception. Actually, creates an Eidolon::Core::Exception object and dies.

rethrow()

Rethrows the exception (if it was thrown before).

overloaded_equ($class)

Overloaded equality comparsion operator (==). Checks if exception is the instance of $class specified.

overloaded_str()

Overloaded stringify operation. Returns exception message.

SEE ALSO ^

Eidolon, Eidolon::Core::Exception::Builder, Eidolon::Core::Exceptions

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR ^

Anton Belousov, <abel@cpan.org>

COPYRIGHT ^

Copyright (c) 2009, Atma 7, http://www.atma7.com

syntax highlighting: