Error::Hierarchy - support for hierarchical exception classes
package Error::Hierarchy::ReadOnlyAttribute; use warnings; use strict; use base 'Error::Hierarchy'; __PACKAGE__->mk_accessors(qw(attribute)); use constant default_message => '[%s] is a read only attribute'; use constant PROPERTIES => ( 'attribute' );
Meanwhile...
package main; use Error::Hierarchy::Mixin; if (...) { Error::Hierarchy::ReadOnlyAttribute-> throw(attribute => 'foo'); }
This class provides support for hierarchical exception classes. It builds upon Error and is thus compatible with its try/catch mechanism. However, it records a lot more information such as the package, filename and line where the exception occurred, a complete stack trace, the hostname and a uuid.
try
catch
It provides a stringification that is extensible with any properties your own exceptions might define.
FIXME: This documentation is still only a stub - I still need to describe all the goodies this class provides. For now, see the synopsis and the other classes in this distribution.
If you talk about this module in blogs, on del.icio.us or anywhere else, please use the errorhierarchy tag.
errorhierarchy
No bugs have been reported.
Please report any bugs or feature requests to bug-error-hierarchy@rt.cpan.org, or through the web interface at http://rt.cpan.org.
bug-error-hierarchy@rt.cpan.org
See perlmodinstall for information and options on installing Perl modules.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.
Marcel Grünauer, <marcel@cpan.org>
<marcel@cpan.org>
Copyright 2007 by Marcel Grünauer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Error::Hierarchy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Error::Hierarchy
CPAN shell
perl -MCPAN -e shell install Error::Hierarchy
For more information on module installation, please visit the detailed CPAN module installation guide.