-
-
18 Mar 2009 21:42:58 UTC
- Distribution: TryCatch-Error
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (153 / 379 / 2)
- Kwalitee
Bus factor: 0- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (20.84KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Moose
- MooseX::FollowPBP
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
TryCatch::Error - A simple error base class.
VERSION
Version 0.01
SYNOPSIS
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
new
Create a new error object:
my $e = TryCatch::Error->new( value => $foo, message => bar );
ACCESSORS
get_*
set_*
The default TryCatch::Error has 2 attributes, value and message, which are an integer and a string.
AUTHOR
Pedro Figueiredo,
<me at pedrofigueiredo.org>
BUGS
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
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
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
Ash Berlin, the author of TryCatch
The Moose crew
COPYRIGHT & LICENSE
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.
Module Install Instructions
To install TryCatch::Error, copy and paste the appropriate command in to your terminal.
cpanm TryCatch::Error
perl -MCPAN -e shell install TryCatch::Error
For more information on module installation, please visit the detailed CPAN module installation guide.