summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/CouldNotCreateMethod.pm
blob: e9497b796aa8afa57b8c07833f31cee9b9a12f6c (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
27
28
29
30
31
package Moose::Exception::CouldNotCreateMethod;
our $VERSION = '2.1405';

use Moose;
extends 'Moose::Exception';
with 'Moose::Exception::Role::Attribute';

has 'option_name' => (
    is       => 'ro',
    isa      => 'Str',
    required => 1
);

has 'option_value' => (
    is       => 'ro',
    isa      => 'Any',
    required => 1
);

has 'error' => (
    is       => 'ro',
    isa      => 'Str',
    required => 1
);

sub _build_message {
    my $self = shift;
    "Could not create the '".$self->option_name."' method for " . $self->attribute->name . " because : ".$self->error;
}

1;