From: Andy Grundman Date: Fri, 18 Nov 2005 04:35:40 +0000 (+0000) Subject: Expanded c->error docs (drewbie) X-Git-Tag: 5.7099_04~883 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=83a8fcacf68e1063b5382835f2f9beb93f4bfe87;hp=8d2fa70c6c45f97e181394e83ca19d0b9009703b Expanded c->error docs (drewbie) --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b7dd179..87fd4af 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -289,7 +289,9 @@ sub detach { my $c = shift; $c->dispatcher->detach( $c, @_ ) } =item $c->error($arrayref) -Returns an arrayref containing error messages. +Returns an arrayref containing error messages. If Catalyst encounters an +error while processing a request, it stores the error in $c->error. This +method should not be used to store non-fatal error messages. my @error = @{ $c->error }; @@ -297,7 +299,8 @@ Add a new error. $c->error('Something bad happened'); -Clear errors. +Clear errors. You probably don't want to clear the errors unless you are +implementing a custom error screen. $c->error(0); diff --git a/lib/Catalyst/Engine/HTTP.pm b/lib/Catalyst/Engine/HTTP.pm index 1d715f5..f685a1e 100644 --- a/lib/Catalyst/Engine/HTTP.pm +++ b/lib/Catalyst/Engine/HTTP.pm @@ -228,8 +228,8 @@ sub _handler { # Initialize CGI environment local %ENV = ( - PATH_INFO => $path || '', - QUERY_STRING => $query_string || '', + PATH_INFO => $path || '', + QUERY_STRING => $query_string || '', REMOTE_ADDR => $sockdata->{peeraddr}, REMOTE_HOST => $sockdata->{peername}, REQUEST_METHOD => $method || '',