From: Yuval Kogman Date: Fri, 15 Aug 2008 15:38:32 +0000 (+0000) Subject: improve error message for existing &meta X-Git-Tag: 0_55_01~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=12a1bdc44df70307a53855eec2dfde7f55ec7345;p=gitmo%2FMoose.git improve error message for existing &meta --- diff --git a/lib/Moose.pm b/lib/Moose.pm index e042a71..b696e19 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -169,7 +169,7 @@ sub init_meta { # override a specific class $meta = Class::MOP::Class->initialize($class); ( blessed($meta) && $meta->isa('Moose::Meta::Class') ) - || confess "You already have a &meta function, but it does not return a Moose::Meta::Class"; + || confess "$class already has a &meta function, but it does not return a Moose::Meta::Class ($meta)"; } else { # NOTE: diff --git a/t/050_metaclasses/003_moose_w_metaclass.t b/t/050_metaclasses/003_moose_w_metaclass.t index bc6db3e..cdf3034 100644 --- a/t/050_metaclasses/003_moose_w_metaclass.t +++ b/t/050_metaclasses/003_moose_w_metaclass.t @@ -51,6 +51,6 @@ isa_ok(Foo->meta, 'Foo::Meta'); eval 'use Moose;'; ::ok($@, '... could not load moose without correct metaclass'); ::like($@, - qr/^You already have a \&meta function\, but it does not return a Moose\:\:Meta\:\:Class/, + qr/^Bar already has a \&meta function\, but it does not return a Moose\:\:Meta\:\:Class/, '... got the right error too'); }