From: Jesse Luehrs Date: Sun, 19 Jun 2011 06:51:53 +0000 (-0500) Subject: also add this error for roles X-Git-Tag: 2.0103~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3eb29da993fac4bbed11365e5f2babb8bcb528e1;p=gitmo%2FMoose.git also add this error for roles --- diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index 7a22a35..c4ed911 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');