feat: use HTML templates for public errors

This commit is contained in:
2025-12-28 17:32:25 +01:00
parent 09abbd84dc
commit 6ce43f4608

View File

@@ -94,8 +94,8 @@ sub startup {
&& $validator->validate_short_code($short_code) )
{
$c->render(
json => { error => 'Invalid short code format' },
status => 400
template => '404',
status => 404
);
return;
}
@@ -109,7 +109,7 @@ sub startup {
}
else {
$c->render(
json => { error => 'Short code not found' },
template => '404',
status => 404
);
}
@@ -120,7 +120,7 @@ sub startup {
return if $c->stash->{rendered};
$c->app->log->error("Redirect lookup error: $err");
$c->render(
json => { error => 'Internal server error' },
template => '500',
status => 500
);
}