Note Catalyst::Base deprecation warnings, tweak setup_finalize doc
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 284f815..d44c2ca 100644 (file)
@@ -43,11 +43,9 @@ sub depth { scalar @{ shift->stack || [] }; }
 sub comp { shift->component(@_) }
 
 sub req {
-    # carp "the use of req() is deprecated in favour of request()";
     my $self = shift; return $self->request(@_);
 }
 sub res {
-    # carp "the use of res() is deprecated in favour of response()";
     my $self = shift; return $self->response(@_);
 }
 
@@ -1482,6 +1480,7 @@ sub execute {
 
     push( @{ $c->stack }, $code );
     
+    no warnings 'recursion';
     eval { $c->state( $code->execute( $class, $c, @{ $c->req->args } ) || 0 ) };
 
     $c->_stats_finish_execute( $stats_info ) if $c->use_stats and $stats_info;
@@ -2185,9 +2184,10 @@ sub setup_component {
         my $metaclass = Moose::Util::find_meta($component);
         my $method_meta = $metaclass->find_method_by_name('COMPONENT');
         my $component_method_from = $method_meta->associated_metaclass->name;
+        my $value = defined($instance) ? $instance : 'undef';
         Catalyst::Exception->throw(
             message =>
-            qq/Couldn't instantiate component "$component", COMPONENT() method (from $component_method_from) didn't return an object-like value./
+            qq/Couldn't instantiate component "$component", COMPONENT() method (from $component_method_from) didn't return an object-like value (value was $value)./
         );
     }
     return $instance;