From: Robert Buels Date: Thu, 5 Aug 2010 05:56:53 +0000 (-0700) Subject: but also we should still throw a Catalyst::Exception if the CGI threw a simple scalar X-Git-Tag: 0.030~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-WrapCGI.git;a=commitdiff_plain;h=f451edec6cb723877985658c4dc25737e5671b17 but also we should still throw a Catalyst::Exception if the CGI threw a simple scalar --- diff --git a/lib/Catalyst/Controller/WrapCGI.pm b/lib/Catalyst/Controller/WrapCGI.pm index a2897a5..88ed2af 100644 --- a/lib/Catalyst/Controller/WrapCGI.pm +++ b/lib/Catalyst/Controller/WrapCGI.pm @@ -6,6 +6,7 @@ use mro 'c3'; extends 'Catalyst::Controller'; +use Catalyst::Exception (); use HTTP::Request::AsCGI (); use HTTP::Request (); use URI (); @@ -233,7 +234,12 @@ sub wrap_cgi { select($old); - die $saved_error if $saved_error; + if( $saved_error ) { + die $saved_error if ref $saved_error; + Catalyst::Exception->throw( + message => "CGI invocation failed: $saved_error" + ); + } } return $env->response;