Show info page in case of error

This commit is contained in:
Danny Spina 2023-06-25 01:14:23 +02:00
parent b037021d0d
commit 8a5746f27e

View File

@ -134,10 +134,14 @@ app.get("/", async (req, res) => {
</html>
`;
const minifiedSerp = minify(html, minifierOptions);
res.set("X-Blaze-Etag", etag(minifiedSerp));
res.send(minifiedSerp);
try {
const minifiedSerp = minify(html, minifierOptions);
res.set("X-Blaze-Etag", etag(minifiedSerp));
res.send(minifiedSerp);
} catch (e) {
console.log("Error during html minifier:", e);
res.sendFile(path.join(__dirname, "/not_blazed.html"));
}
};
xhr.send();
} catch (err) {