X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FView.pm;h=286fc889ca3d8eb723f9b1facb8450c5d87419e7;hb=067d48ee88e1337e1bfc35b56188fbb438377155;hp=6379fa3ef98bee9ffe7de59c81b4a71438784308;hpb=3d8a0645a8c77bb59d727b4357b9142c7f66016a;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/Serialize/View.pm b/lib/Catalyst/Action/Serialize/View.pm index 6379fa3..286fc88 100644 --- a/lib/Catalyst/Action/Serialize/View.pm +++ b/lib/Catalyst/Action/Serialize/View.pm @@ -1,8 +1,8 @@ package Catalyst::Action::Serialize::View; -use strict; -use warnings; +use Moose; +use namespace::autoclean; -use base 'Catalyst::Action'; +extends 'Catalyst::Action'; sub execute { my $self = shift; @@ -16,10 +16,18 @@ sub execute { if ( !$c->view($view) ) { $c->log->error("Could not load $view, refusing to serialize"); - return 0; + return; } - return $c->view($view)->process($c, $stash_key); + if ($c->view($view)->process($c, $stash_key)) { + return 1; + } else { + # This is stupid. Please improve it. + my $error = join("\n", @{ $c->error }) || "Error in $view"; + $error .= "\n"; + $c->clear_errors; + die $error; + } } 1;