1 package Moose::Error::Croak;
6 use base qw(Moose::Error::Default);
9 my ( $self, @args ) = @_;
10 $self->create_error_croak(@args);
14 my ( $self, %args ) = @_;
16 my $depth = ($args{depth} || 0) - 1;
17 return 'Moose::Error::Util::create_error_croak('
18 . 'message => ' . $args{message} . ', '
19 . 'depth => ' . $depth . ', '
25 # ABSTRACT: Prefer C<croak>
33 # Metaclass definition must come before Moose is used.
35 metaclass => 'Moose::Meta::Class',
36 error_class => 'Moose::Error::Croak',
43 This error class uses L<Carp/croak> to raise errors generated in your
52 Overrides L<Moose::Error::Default/new> to prefer C<croak>.