NAME

Helix::Core::Exception - base exception class for Helix Framework.

SYNOPSIS

General exception usage example:

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

    # ...
};

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

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

DESCRIPTION

The Helix::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.

_init()

Exception initializaton. Tracks file name and line where exception occured.

throw()

Throws exception. Actually, creates an Helix::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

Helix, Helix::Core::Exception::Builder, Helix::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