1 package Catalyst::Action::Serialize::View;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
10 my ( $controller, $c, $view ) = @_;
12 # Views don't care / are not going to render an entity for 3XX
14 return 1 if $c->response->status =~ /^(?:204|3\d\d)$/;
17 $controller->{'serialize'} ?
18 $controller->{'serialize'}->{'stash_key'} :
19 $controller->{'stash_key'}
22 if ( !$c->view($view) ) {
23 $c->log->error("Could not load $view, refusing to serialize");
27 if ($c->view($view)->process($c, $stash_key)) {
30 # This is stupid. Please improve it.
31 my $error = join("\n", @{ $c->error }) || "Error in $view";
38 __PACKAGE__->meta->make_immutable;