Eidolon::Core::Exception::Builder - exception builder for Eidolon.


Eidolon documentation  | view source Contained in the Eidolon distribution.

Index


NAME

Top

Eidolon::Core::Exception::Builder - exception builder for Eidolon.

SYNOPSIS

Top

In one of your application files, for example lib/Example/Exceptions.pm you can write:

    use Eidolon::Core::Exception::Builder
    (
        "MyException" =>
        {
            "title" => "Something happened."
        },

        "MyException::Terrible" =>
        {
            "isa"   => "MyException",
            "title" => "Something terrble happened."
        },

        "MyException::Good" =>
        {
            "isa"   => "MyException",
            "title" => "Something good happened."
        }
    );

DESCRIPTION

Top

The Eidolon::Core::Exception::Builder class provides an easy way to create own exceptions. It has no methods that you should call - all work is done during package import.

METHODS

Top

import($class, $data)

Creates exception $class with $data settings. $data is a hashref, containing inheritance information and exception message:

* isa

Exception base class.

* title

Exception message.

If no isa information is specified, Eidolon::Core::Exception will be used as a base exception class.

SEE ALSO

Top

Eidolon, Eidolon::Core::Exception

LICENSE

Top

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

AUTHOR

Top

Anton Belousov, <abel@cpan.org>

COPYRIGHT

Top


Eidolon documentation  | view source Contained in the Eidolon distribution.