diff options
Diffstat (limited to 'lib/Moose/Exception/MatchActionMustBeACodeRef.pm')
-rw-r--r-- | lib/Moose/Exception/MatchActionMustBeACodeRef.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Moose/Exception/MatchActionMustBeACodeRef.pm b/lib/Moose/Exception/MatchActionMustBeACodeRef.pm new file mode 100644 index 0000000..c0c7fb8 --- /dev/null +++ b/lib/Moose/Exception/MatchActionMustBeACodeRef.pm @@ -0,0 +1,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; |