The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Ambrosia::error::Exception - an unspecified exception. Ambrosia::error::Exception::BadUsage - this exception will occur if you use something incorrect. Ambrosia::error::Exception::BadParams - this exception will occur if you use incorrect parameters. Ambrosia::error::Exception::AccessDenied - this exception will occur if you try run closed method.

SYNOPSIS

    use Ambrosia::error::Exceptions;

    sub test
    {
        unless ( @_ )
        {
            throw Ambrosia::error::Exception::BadParams("Must call test with arguments.");
        }
    }

    eval
    {
        test();
    };
    if ( $@ )
    {
        if ( ref $@ && $@->isa('Ambrosia::error::Exception::Error') )
        {
            print "ERROR: " . $@->message . "\n";
            print "STACK:\n" . $@->stack . "\n";
            print "CODE: " . $@->code . "\n";

            #printed:
            #ERROR: Must call test with arguments.
            #ERROR: Must call test with arguments.
            #STACK:
            #    Ambrosia::error::Exception::BadParams::throw( Ambrosia::error::Exception::BadParams, Must call test with arguments. ) at main line ...
            #    main::test(  ) at main line ...
            #    (eval) at main line ...
            #CODE: E0002

            #ERROR: Must call test with arguments.
            #STACK:
            #    Ambrosia::error::Exception::BadParams::throw( Ambrosia::error::Exception::BadParams, Must call test with arguments. ) at main line ...
            #    main::test(  ) at main line ...
            #    (eval) at main line ...
        }
        #or you can do so:
        print "ERROR: $@";

        #printed:
        #ERROR: Must call test with arguments.
        #    Ambrosia::error::Exception::BadParams::throw( Ambrosia::error::Exception::BadParams, Must call test with arguments. ) at main line ...
        #    main::test(  ) at main line ...
        #    (eval) at main line ...
    }

DESCRIPTION

List of different types of exceptions. Ambrosia::error::Exception - an unspecified exception. Ambrosia::error::Exception::BadUsage - this exception will occur if you use something incorrect. Ambrosia::error::Exception::BadParams - this exception will occur if you use incorrect parameters. Ambrosia::error::Exception::AccessDenied - this exception will occur if you try run closed method.

Ambrosia::error::Exception

System exception of undefined type.

Ambrosia::error::Exception::BadUsage

Incorrect use of the method of the class.

Ambrosia::error::Exception::BadParams

Bad parameters.

Ambrosia::error::Exception::AccessDenied

Trying to use a private field or method.

THREADS

Not tested.

BUGS

Please report bugs relevant to Ambrosia to <knm[at]cpan.org>.

COPYRIGHT AND LICENSE

Copyright (C) 2010-2012 Nickolay Kuritsyn. All rights reserved.

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

AUTHOR

Nikolay Kuritsyn (knm[at]cpan.org)