MooseX::Constructor::AllErrors - Capture all constructor errors
version 0.025
package MyClass; use MooseX::Constructor::AllErrors; has foo => (is => 'ro', required => 1); has bar => (is => 'ro', isa => 'Int'); ... eval { MyClass->new(bar => "hello") }; # $@->errors has two errors, not just the missing required attribute
MooseX::Constructor::AllErrors tries to capture every error generated during the construction of your objects, rather than halting after the first.
If there are errors, $@ will contain a MooseX::Constructor::AllErrors::Error::Constructor object. See its documentation for possible error types.
$@
Moose
Hans Dieter Pearcey <hdp@cpan.org>
Karen Etheridge <ether@cpan.org>
Hans Dieter Pearcey <hdp@weftsoar.net>
Jesse Luehrs <doy@tozt.net>
Shawn Sorichetti <ssoriche@gmail.com>
This software is copyright (c) 2009 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install MooseX::Constructor::AllErrors, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Constructor::AllErrors
CPAN shell
perl -MCPAN -e shell install MooseX::Constructor::AllErrors
For more information on module installation, please visit the detailed CPAN module installation guide.