diff --git a/lolisafe.js b/lolisafe.js index db9b292..9f0cc78 100644 --- a/lolisafe.js +++ b/lolisafe.js @@ -62,10 +62,11 @@ for (let page of config.pages) { // NOTE: Uses fiery-me branch of https://github.com/BobbyWibowo/HttpErrorPages safe.use((req, res, next) => { - const errorCodes = [400, 401, 403, 404, 500, 501, 502, 503, 520, 521, 533] - for (const e of errorCodes) { - res.status(e).sendFile(`HTTP${e}.html`, { root: '../HttpErrorPages/dist/' }) - } + res.status(404).sendFile('HTTP404.html', { root: '../HttpErrorPages/dist/' }) +}) +safe.use((err, req, res, next) => { + console.error(err) + res.status(500).sendFile('HTTP505.html', { root: '../HttpErrorPages/dist/' }) }) safe.listen(config.port, () => console.log(`lolisafe started on port ${config.port}`))