Author image Jan Krynick√Ĺ
and 1 contributors


Exception::Class::Nested - Nested declaration of Exception::Class classes


        use Exception::Class::Nested (
                'MyException' => {
                        description => 'This is mine!',

                        'YetAnotherException' => {
                                description => 'These exceptions are related to IPC',

                                'ExceptionWithFields' => {
                                        fields => [ 'grandiosity', 'quixotic' ],
                                        alias => 'throw_fields',
                                        full_message => sub {
                                                my $self = shift;
                                                my $msg = $self->message;
                                                $msg .= " and grandiosity was " . $self->grandiosity;
                                                return $msg;


This is little more than a thin wrapper around the use Exception::Class call. It allows you do nest the class declarations instead of having to repeat the class names in the isa=> parameters. It also allows you to define/overload methods in the classes.


Please submit bugs to the CPAN RT system at or via email at


Jenda Krynicky, <>


Copyright (c) 2008 Jenda Krynicky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.