TryCatch::Error - A simple error base class.
Version 0.01
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).
Create a new error object:
my $e = TryCatch::Error->new( value => $foo, message => bar );
The default TryCatch::Error has 2 attributes, value and message, which are an integer and a string.
Pedro Figueiredo, <me at pedrofigueiredo.org>
<me at pedrofigueiredo.org>
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.
bug-trycatch-error at rt.cpan.org
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/
Ash Berlin, the author of TryCatch
The Moose crew
Copyright 2009 Pedro Figueiredo, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install TryCatch::Error, copy and paste the appropriate command in to your terminal.
cpanm
cpanm TryCatch::Error
CPAN shell
perl -MCPAN -e shell install TryCatch::Error
For more information on module installation, please visit the detailed CPAN module installation guide.