summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/MatchActionMustBeACodeRef.pm
blob: c0c7fb8878275d26312070a99a7ad070b5d1f7c0 (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
package Moose::Exception::MatchActionMustBeACodeRef;
our $VERSION = '2.1405';

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

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

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

sub _build_message {
    my $self = shift;
    my $action = $self->action;

    return "Match action must be a CODE ref, not $action";
}

1;