From: Matt S Trout Date: Wed, 25 Jan 2006 19:35:50 +0000 (+0000) Subject: Fixups to ACCEPT_CONTEXT and COMPONENT X-Git-Tag: 5.7099_04~726 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=6c5033cb8b3a6ab2da7e0c7cdc7d59594cd88787 Fixups to ACCEPT_CONTEXT and COMPONENT --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 5a91f46..b1f8578 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -373,7 +373,7 @@ sub component { if ( exists $c->components->{$try} ) { my $comp = $c->components->{$try}; - if ( ref $comp && $comp->can('ACCEPT_CONTEXT') ) { + if ( eval { $comp->can('ACCEPT_CONTEXT'); } ) { return $comp->ACCEPT_CONTEXT($c); } else { return $comp } @@ -1584,7 +1584,7 @@ sub setup_components { } Catalyst::Exception->throw( message => -qq/Couldn't instantiate component "$component", "new() didn't return a object"/ +qq/Couldn't instantiate component "$component", "COMPONENT() didn't return a object"/ ) unless ref $instance; return $instance;