this only matters for lazy attributes with initializers
[gitmo/Moose.git] / lib / Moose / Error / Croak.pm
CommitLineData
bf6fa6b3 1package Moose::Error::Croak;
2
c0e91e5f 3use strict;
4use warnings;
5
bf6fa6b3 6use base qw(Moose::Error::Default);
7
8sub new {
9 my ( $self, @args ) = @_;
10 $self->create_error_croak(@args);
11}
12
9c1bf11e 131;
bf6fa6b3 14
ad46f524 15# ABSTRACT: Prefer C<croak>
16
bf6fa6b3 17__END__
18
19=pod
20
bf6fa6b3 21=head1 SYNOPSIS
22
af1c30e0 23 # Metaclass definition must come before Moose is used.
24 use metaclass (
25 metaclass => 'Moose::Meta::Class',
26 error_class => 'Moose::Error::Croak',
bf6fa6b3 27 );
af1c30e0 28 use Moose;
29 # ...
bf6fa6b3 30
31=head1 DESCRIPTION
32
33This error class uses L<Carp/croak> to raise errors generated in your
34metaclass.
35
36=head1 METHODS
37
38=over 4
39
40=item new
41
42Overrides L<Moose::Error::Default/new> to prefer C<croak>.
43
44=back
45
46=cut
47
48