blob: 1a460c14a56629d5f008ef0aa5df1d3558614eb7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package Moose::Exception::ReferencesAreNotAllowedAsDefault;
our $VERSION = '2.1405';
use Moose;
extends 'Moose::Exception';
with 'Moose::Exception::Role::ParamsHash';
has 'class' => (
is => 'ro',
isa => 'Str',
required => 1
);
has 'attribute_name' => (
is => 'ro',
isa => 'Str',
required => 1
);
sub _build_message {
my $self = shift;
"References are not allowed as default values, you must wrap the default of '".
$self->attribute_name."' in a CODE reference (ex: sub { [] } and not [])";
}
1;
|