Murat Ünalan > Class-Maker-0.5.14 > Class::Maker::Exception

Download:
Class-Maker-0.5.14.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  2
View/Report Bugs
Module Version: 0.0.1   Source   Latest Release: Class-Maker-0.05.18

NAME ^

Class::Maker::Exception - exceptions tuned for Class::Maker

SYNOPSIS ^

        use Class::Maker qw(class);
        
        use Class::Maker::Exception qw(:try);
                
        {
        package Exception::Child;
        
                Class::Maker::class
                {
                        isa => [qw( Class::Maker::Exception )],
        
                        public =>
                        {
                                string => [qw( email )],
                        },
                };
        
        package Exception::ChildChild;
        
                Class::Maker::class
                {
                        isa => [qw( Exception::Child )],
        
                        public =>
                        {
                                string => [qw( name )],
                        },
                };
        }
        
        sub do_some_stuff
        {
                Exception::ChildChild->throw( email => 'bla@bla.de', name => 'johnny' );
        
        return;
        }
        
                try
                {
                        do_some_stuff();
        
                }
                catch Exception::ChildChild with
                {
                        foreach my $e (@_)
                        {
                                print Dumper $e;
                        }
                };

DESCRIPTION ^

This is mainly a wrapper to "Error" from CPAN. Because it has a very odd inheritance mechanism, this wrapper is needed as a workarround.

syntax highlighting: