TryCatch::Error - A simple error base class.


TryCatch-Error documentation  | view source Contained in the TryCatch-Error distribution.

Index


NAME

Top

TryCatch::Error - A simple error base class.

VERSION

Top

Version 0.01

SYNOPSIS

Top

This module provides a building block to writing your own error objects, to use with TryCatch (or some similar module).

It enables you to write things like this, straight away:

    use TryCatch::Error;
    use TryCatch;

    try {
        # ...
        # something that can go horribly wrong
        if ( $error_condition ) {
            die TryCatch::Error->new( value => $foo, message => $bar );
        }
    }
    catch ( TryCatch::Error $e ) {
        print STDERR 'Ooops: ', $e->get_message, ' with ', $e->get_value;
    }

TryCatch::Error can be sub-classed to create your own errors (possibly containing more detail, see t/03-subclassing.t for an example).

FUNCTIONS

Top

new

Create a new error object:

    my $e = TryCatch::Error->new( value => $foo, message => bar );

ACCESSORS

Top

get_*

set_*

The default TryCatch::Error has 2 attributes, value and message, which are an integer and a string.

AUTHOR

Top

Pedro Figueiredo, <me at pedrofigueiredo.org>

BUGS

Top

Please report any bugs or feature requests to bug-trycatch-error at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=TryCatch-Error. 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 TryCatch::Error




You can also look for information at:

* RT: CPAN's request tracker

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

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/TryCatch-Error

* CPAN Ratings

http://cpanratings.perl.org/d/TryCatch-Error

* Search CPAN

http://search.cpan.org/dist/TryCatch-Error/

ACKNOWLEDGEMENTS

Top

* Ash Berlin, the author of TryCatch
* The Moose crew

COPYRIGHT & LICENSE

Top


TryCatch-Error documentation  | view source Contained in the TryCatch-Error distribution.