From: Jesse Luehrs Date: Sun, 19 Jun 2011 06:51:53 +0000 (-0500) Subject: also add this error for roles X-Git-Tag: 2.0009~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e83012ab50732cffe76df75701f9d3fb2524d6e7;p=gitmo%2FMoose.git also add this error for roles --- diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index 1cbc9ff..09029b7 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -106,6 +106,9 @@ sub init_meta { my $metaclass = $args{metaclass} || "Moose::Meta::Role"; my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta'; + Moose->throw_error("The Metaclass $metaclass must be loaded. (Perhaps you forgot to 'use $metaclass'?)") + unless Class::MOP::is_class_loaded($metaclass); + Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Role.") unless $metaclass->isa('Moose::Meta::Role');