From: Christian Hansen Date: Sun, 10 Apr 2005 23:21:24 +0000 (+0000) Subject: Fixed t/engine/response* X-Git-Tag: 5.7099_04~1567 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=3b2ed58088aa6b714f24cb4c76484c7dda8cfe30 Fixed t/engine/response* --- diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index fd99ba4..94dd80d 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -121,7 +121,9 @@ sub forward { unless ( @{$results} ) { my $class = $command; if ( $class =~ /[^\w\:]/ ) { - $c->log->debug(qq/Couldn't forward to "$class"/) if $c->debug; + my $error = qq/Couldn't forward to "$class"/; + $c->error($error); + $c->log->debug($error) if $c->debug; return 0; } my $method = shift || 'process'; @@ -130,7 +132,9 @@ sub forward { $results = [ [ [ $class, $code ] ] ]; } else { - $c->log->debug(qq/Couldn't forward to "$class->$method"/) + my $error = qq/Couldn't forward to "$class->$method"/; + $c->error($error); + $c->log->debug($error) if $c->debug; return 0; } diff --git a/t/engine/response/errors.t b/t/engine/response/errors.t index 411af4f..3cb4e42 100644 --- a/t/engine/response/errors.t +++ b/t/engine/response/errors.t @@ -24,7 +24,7 @@ use Catalyst::Test 'TestApp'; is( $response->code, 404, 'Response Code' ); is( $response->content_type, 'text/html', 'Response Content-Type' ); is( $response->header('X-Catalyst-Action'), 'engine/response/errors/two', 'Test Action' ); - like( $response->header('X-Catalyst-Error'), qr/^Unknown resource/, 'Catalyst Error' ); + like( $response->header('X-Catalyst-Error'), qr/^Couldn't forward to/, 'Catalyst Error' ); } {