line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Exception::AttributeIsRequired; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2206'; |
3
|
|
|
|
|
|
|
|
4
|
14
|
|
|
14
|
|
9569
|
use Moose; |
|
14
|
|
|
|
|
42
|
|
|
14
|
|
|
|
|
105
|
|
5
|
|
|
|
|
|
|
extends 'Moose::Exception'; |
6
|
|
|
|
|
|
|
with 'Moose::Exception::Role::Class'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'attribute_name' => ( |
9
|
|
|
|
|
|
|
is => 'ro', |
10
|
|
|
|
|
|
|
isa => 'Str', |
11
|
|
|
|
|
|
|
required => 1, |
12
|
|
|
|
|
|
|
documentation => "This attribute can be used for fetching attribute instance:\n". |
13
|
|
|
|
|
|
|
" my \$class = Moose::Util::find_meta( \$exception->class_name );\n". |
14
|
|
|
|
|
|
|
" my \$attribute = \$class->get_attribute( \$exception->attribute_name );\n", |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has 'attribute_init_arg' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
isa => 'Str', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has 'params' => ( |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
isa => 'HashRef', |
25
|
|
|
|
|
|
|
predicate => 'has_params', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _build_message { |
29
|
60
|
|
|
60
|
|
163
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
60
|
|
|
|
|
2167
|
my $name = $self->attribute_name; |
32
|
60
|
|
|
|
|
192
|
my $msg = "Attribute ($name)"; |
33
|
|
|
|
|
|
|
|
34
|
60
|
|
|
|
|
1996
|
my $init_arg = $self->attribute_init_arg; |
35
|
60
|
100
|
66
|
|
|
329
|
if ( defined $init_arg && $name ne $init_arg ) { |
36
|
1
|
|
|
|
|
4
|
$msg .= ", passed as ($init_arg),"; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
60
|
|
|
|
|
173
|
$msg .= ' is required'; |
40
|
|
|
|
|
|
|
|
41
|
60
|
|
|
|
|
1547
|
return $msg; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
45
|
|
|
|
|
|
|
1; |