Add ENDPOINT_OVERRIDEN error symbol

Show proper 404 page for /u/privacy, /u/accounts, etc
This commit is contained in:
Cadence Fish
2020-02-06 01:32:51 +13:00
parent f8f670c4a9
commit 3b1c6a2849
4 changed files with 6 additions and 4 deletions

View File

@@ -60,7 +60,7 @@ module.exports = [
}
return render(200, "pug/user.pug", {url, user, constants})
}).catch(error => {
if (error === constants.symbols.NOT_FOUND) {
if (error === constants.symbols.NOT_FOUND || error === constants.symbols.ENDPOINT_OVERRIDDEN) {
return render(404, "pug/friendlyerror.pug", {
statusCode: 404,
title: "Not found",
@@ -100,7 +100,7 @@ module.exports = [
}
}
}).catch(error => {
if (error === constants.symbols.NOT_FOUND) {
if (error === constants.symbols.NOT_FOUND || error === constants.symbols.ENDPOINT_OVERRIDDEN) {
return render(404, "pug/friendlyerror.pug", {
statusCode: 404,
title: "Not found",