summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/MethodExpectsMoreArgs.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Moose/Exception/MethodExpectsMoreArgs.pm')
-rw-r--r--lib/Moose/Exception/MethodExpectsMoreArgs.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Moose/Exception/MethodExpectsMoreArgs.pm b/lib/Moose/Exception/MethodExpectsMoreArgs.pm
new file mode 100644
index 0000000..d0e82cf
--- /dev/null
+++ b/lib/Moose/Exception/MethodExpectsMoreArgs.pm
@@ -0,0 +1,24 @@
+package Moose::Exception::MethodExpectsMoreArgs;
+our $VERSION = '2.1405';
+
+use Moose;
+extends 'Moose::Exception';
+
+has 'method_name' => (
+ is => 'ro',
+ isa => 'Str',
+ required => 1
+);
+
+has 'minimum_args' => (
+ is => 'ro',
+ isa => 'Int',
+ required => 1
+);
+
+sub _build_message {
+ my $self = shift;
+ "Cannot call ".$self->method_name." without at least ".$self->minimum_args." argument".($self->minimum_args == 1 ? '' : 's');
+}
+
+1;