Commit | Line | Data |
---|---|---|
bf6fa6b3 | 1 | package Moose::Error::Confess; |
2 | ||
c0e91e5f | 3 | use strict; |
4 | use warnings; | |
5 | ||
bf6fa6b3 | 6 | use base qw(Moose::Error::Default); |
7 | ||
2f8c8480 | 8 | sub new { |
9 | my ( $self, @args ) = @_; | |
10 | $self->create_error_confess(@args); | |
11 | } | |
12 | ||
bcc04ae1 | 13 | sub _inline_new { |
14 | my ( $self, @args ) = @_; | |
15 | ||
16 | return $self->_inline_create_error_carpmess(@args, longmess => 1); | |
17 | } | |
18 | ||
9c1bf11e | 19 | 1; |
bf6fa6b3 | 20 | |
ad46f524 | 21 | # ABSTRACT: Prefer C<confess> |
22 | ||
bf6fa6b3 | 23 | __END__ |
24 | ||
25 | =pod | |
26 | ||
bf6fa6b3 | 27 | =head1 SYNOPSIS |
28 | ||
af1c30e0 | 29 | # Metaclass definition must come before Moose is used. |
30 | use metaclass ( | |
31 | metaclass => 'Moose::Meta::Class', | |
32 | error_class => 'Moose::Error::Confess', | |
bf6fa6b3 | 33 | ); |
af1c30e0 | 34 | use Moose; |
35 | # ... | |
bf6fa6b3 | 36 | |
37 | =head1 DESCRIPTION | |
38 | ||
39 | This error class uses L<Carp/confess> to raise errors generated in your | |
40 | metaclass. | |
41 | ||
42 | =cut | |
43 | ||
44 | ||
45 |