Updated: Better Dispatcher error messages.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index fb80e11..257a8cd 100644 (file)
@@ -126,7 +126,7 @@ Errors are available via $c->error.
 
 sub execute {
     my ( $c, $class, $code ) = @_;
-    $class = $c->comp($class) || $class;
+    $class = $c->components->{$class} || $class;
     $c->state(0);
     my $callsub = ( caller(1) )[3];
 
@@ -179,13 +179,13 @@ sub finalize {
         $c->finalize_error;
     }
 
-    if ( !$c->response->output && $c->response->status !~ /^(1|3)\d\d$/ ) {
+    if ( !$c->response->body && $c->response->status !~ /^(1|3)\d\d$/ ) {
         $c->finalize_error;
     }
 
-    if ( $c->response->output && !$c->response->content_length ) {
+    if ( $c->response->body && !$c->response->content_length ) {
         use bytes;    # play safe with a utf8 aware perl
-        $c->response->content_length( length $c->response->output );
+        $c->response->content_length( length $c->response->body );
     }
 
     my $status = $c->finalize_headers;
@@ -193,6 +193,10 @@ sub finalize {
     return $status;
 }
 
+=item $c->finalize_output
+
+alias to finalize_body
+
 =item $c->finalize_body
 
 Finalize body.
@@ -271,7 +275,7 @@ sub finalize_error {
 
         $name = '';
     }
-    $c->res->output( <<"" );
+    $c->res->body( <<"" );
 <html>
 <head>
     <title>$title</title>
@@ -335,7 +339,7 @@ Finalize headers.
 
 sub finalize_headers { }
 
-=item $c->handler( $class, $r )
+=item $c->handler( $class, $engine )
 
 Handles the request.
 
@@ -391,7 +395,7 @@ into a Catalyst context .
 =cut
 
 sub prepare {
-    my ( $class, $r ) = @_;
+    my ( $class, $engine ) = @_;
 
     my $c = bless {
         request => Catalyst::Request->new(
@@ -420,7 +424,7 @@ sub prepare {
         $c->res->headers->header( 'X-Catalyst' => $Catalyst::VERSION );
     }
 
-    $c->prepare_request($r);
+    $c->prepare_request($engine);
     $c->prepare_path;
     $c->prepare_headers;
     $c->prepare_cookies;