feat: use HTML templates for public errors
This commit is contained in:
@@ -94,8 +94,8 @@ sub startup {
|
|||||||
&& $validator->validate_short_code($short_code) )
|
&& $validator->validate_short_code($short_code) )
|
||||||
{
|
{
|
||||||
$c->render(
|
$c->render(
|
||||||
json => { error => 'Invalid short code format' },
|
template => '404',
|
||||||
status => 400
|
status => 404
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,8 +109,8 @@ sub startup {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$c->render(
|
$c->render(
|
||||||
json => { error => 'Short code not found' },
|
template => '404',
|
||||||
status => 404
|
status => 404
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,8 +120,8 @@ sub startup {
|
|||||||
return if $c->stash->{rendered};
|
return if $c->stash->{rendered};
|
||||||
$c->app->log->error("Redirect lookup error: $err");
|
$c->app->log->error("Redirect lookup error: $err");
|
||||||
$c->render(
|
$c->render(
|
||||||
json => { error => 'Internal server error' },
|
template => '500',
|
||||||
status => 500
|
status => 500
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user