NAME

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

SYNOPSIS

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

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

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

Eidolon, Eidolon::Core::Exception

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