Error::Exception::Class - A wrapper around L<Exception::Class> that uses


Error-Exception documentation Contained in the Error-Exception distribution.

Index


Code Index:

NAME

Top

Error::Exception::Class - A wrapper around Exception::Class that uses Error::Exception as the default base class instead of Exception::Class::Base.

SYNOPSIS

Top

Error::Exception::Class is a drop-in replacement for Exception::Class that ensure that classes without an "isa" attribute inherit from Error::Exception instead of the default Exception::Class::Base.

Use it the same as you would Exception::Class.

AUTHOR

Top

Stephen Vance, <steve at vance.com>

BUGS

Top

Please report any bugs or feature requests to bug-error-exception-class at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Error-Exception-Class. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Error::Exception::Class

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Error-Exception-Class

* CPAN Ratings

http://cpanratings.perl.org/d/Error-Exception-Class

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Error-Exception-Class

* Search CPAN

http://search.cpan.org/dist/Error-Exception-Class

ACKNOWLEDGEMENTS

Top

Thank you to The MathWorks, Inc. for sponsoring this work and to the BaT Team for their valuable input, review, and contributions. Also, thank you to Damian Conway for wonderful training and helpful advice.

COPYRIGHT

Top

LICENSE

Top

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


Error-Exception documentation Contained in the Error-Exception distribution.

# Copyright (C) 2008 Stephen Vance
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the Perl Artistic License.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Perl
# Artistic License for more details.
# 
# You should have received a copy of the Perl Artistic License along
# with this library; if not, see:
#
#       http://www.perl.com/language/misc/Artistic.html
# 
# Designed and written by Stephen Vance (steve@vance.com) on behalf
# of The MathWorks, Inc.

package Error::Exception::Class;

use strict;
use warnings;

use base qw( Exception::Class );

our $VERSION = '1.0';

sub import {
    my ($pkg, @exceptions) = @_;

    local $Exception::Class::BASE_EXC_CLASS = 'Error::Exception';

    local *CORE::GLOBAL::caller = sub {
        my ($n) = @_ ? @_ : 0;
        return CORE::caller( $n + 1 );
    };

    $pkg->SUPER::import( @exceptions );

    return;
}

1;
__END__