From 720a96948487689a93ed0abae3a0a36745fd6dd5 Mon Sep 17 00:00:00 2001 From: grey Date: Sun, 9 Jul 2023 18:14:29 +0200 Subject: [PATCH] respond with proper error page when the /s/:id sku fails --- src/routes/frontend/itemInfo.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/frontend/itemInfo.ts b/src/routes/frontend/itemInfo.ts index 1b257e5..a54e416 100644 --- a/src/routes/frontend/itemInfo.ts +++ b/src/routes/frontend/itemInfo.ts @@ -29,7 +29,9 @@ function get(req: Request, res: Response) { res.send(html); }); } else { - res.send('Item not found'); + Eta.renderFile(__path + '/src/frontend/errors/404.eta.html', item).then((html) => { + res.status(404).send(html); + }); } }); }