summaryrefslogtreecommitdiff
path: root/lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /lib/Moose/Exception/InstanceBlessedIntoWrongClass.pm
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
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;