From: Shawn M Moore Date: Tue, 25 Nov 2008 06:40:56 +0000 (+0000) Subject: More consistent errors for roles (don't really want to specify Moose::Role) X-Git-Tag: 0.62~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b894592117fa84ebc49754ad5695d4b78d136a27;p=gitmo%2FMoose.git More consistent errors for roles (don't really want to specify Moose::Role) --- diff --git a/Changes b/Changes index 2ccc252..eeae12e 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,8 @@ Revision history for Perl extension Moose - create method for constructing a role dynamically (Sartak) - begin implementing anonymous roles (Sartak) + * Moose::Role + - more consistent error messages (Sartak) 0.61 Fri November 7, 2008 * Moose::Meta::Attribute diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index 025aa7d..352db60 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -54,7 +54,7 @@ sub before { my $code = pop @_; for (@_) { - croak "Moose::Role do not currently support " + croak "Roles do not currently support " . ref($_) . " references for before method modifiers" if ref $_; @@ -67,7 +67,7 @@ sub after { my $code = pop @_; for (@_) { - croak "Moose::Role do not currently support " + croak "Roles do not currently support " . ref($_) . " references for after method modifiers" if ref $_; @@ -79,7 +79,7 @@ sub around { my $meta = Moose::Meta::Role->initialize(shift); my $code = pop @_; for (@_) { - croak "Moose::Role do not currently support " + croak "Roles do not currently support " . ref($_) . " references for around method modifiers" if ref $_; @@ -100,11 +100,11 @@ sub override { } sub inner { - croak "Moose::Role cannot support 'inner'"; + croak "Roles cannot support 'inner'"; } sub augment { - croak "Moose::Role cannot support 'augment'"; + croak "Roles cannot support 'augment'"; } my $exporter = Moose::Exporter->setup_import_methods(