diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 146c37a4..a486091f 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -237,7 +237,13 @@ sub end : ActionClass('RenderView') { elsif (scalar @{$c->error}) { $c->stash->{resource} = { error => join "\n", @{$c->error} }; - $c->stash->{template} = 'error.tt'; + if ($c->stash->{lazy}) { + $c->response->headers->header('X-Hydra-Lazy', 'Yes'); + $c->stash->{template} = 'lazy_error.tt'; + } + else { + $c->stash->{template} = 'error.tt'; + } $c->stash->{errors} = $c->error; $c->response->status(500) if $c->response->status == 200; if ($c->response->status >= 300) { diff --git a/src/root/lazy_error.tt b/src/root/lazy_error.tt new file mode 100644 index 00000000..38bcfcb6 --- /dev/null +++ b/src/root/lazy_error.tt @@ -0,0 +1,5 @@ +[% PROCESS common.tt %] + +[% FOREACH error IN errors %] +