summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm')
-rw-r--r--lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm b/lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm
new file mode 100644
index 0000000..4d4faff
--- /dev/null
+++ b/lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm
@@ -0,0 +1,13 @@
+package Moose::Exception::InstanceBlessedIntoWrongClass;
+our $VERSION = '2.1405';
+
+use Moose;
+extends 'Moose::Exception';
+with 'Moose::Exception::Role::ParamsHash', 'Moose::Exception::Role::Class', 'Moose::Exception::Role::Instance';
+
+sub _build_message {
+ my $self = shift;
+ "Objects passed as the __INSTANCE__ parameter must already be blessed into the correct class, but ".$self->instance." is not a " . $self->class_name;
+}
+
+1;