Set a 500 HTTP status on errors

This commit is contained in:
Eelco Dolstra 2013-02-22 14:27:38 +01:00
parent 961feedf4e
commit f2de374f28

View file

@ -191,6 +191,7 @@ sub end : ActionClass('RenderView') {
if (scalar @{$c->error}) {
$c->stash->{template} = 'error.tt';
$c->stash->{errors} = $c->error;
$c->response->status(500) if $c->response->status == 200;
if ($c->response->status >= 300) {
$c->stash->{httpStatus} =
$c->response->status . " " . HTTP::Status::status_message($c->response->status);