The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

General exception usage example:

    eval
    {
        # ...
        
        throw Error::Core::Router::NotFound("Oops!");

        # ...
    };

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

        if ($e == "Error::Core::Router::NotFound")
        {
            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::Exception::List

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