From: gfx Date: Fri, 10 Sep 2010 04:02:06 +0000 (+0900) Subject: Fix an error message for method modifiers X-Git-Tag: 0.66~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=083e49a57775e723816a031224ce5e8bbca8f3df Fix an error message for method modifiers --- diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index b8b2e4d..476d8bf 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -276,7 +276,7 @@ sub _install_modifier_pp{ my $into = $self->name; my $original = $into->can($name) - or $self->throw_error("The method '$name' is not found in the inheritance hierarchy for class $into"); + or $self->throw_error("The method '$name' was not found in the inheritance hierarchy for $into"); my $modifier_table = $self->{modifiers}{$name}; @@ -361,7 +361,7 @@ sub _install_modifier { if ( !$method || !Data::Util::subroutine_modifier($method) ) { unless ($method) { $method = $into->can($name) - or Carp::confess("The method '$name' is not found in the inheritance hierarchy for class $into"); + or $self->throw_error("The method '$name' was not found in the inheritance hierarchy for $into"); } $method = Data::Util::modify_subroutine( $method, $type => [$code] );