errorhandling
This commit is contained in:
parent
33064030d6
commit
3b34234c2f
|
@ -27,4 +27,9 @@ app
|
|||
|
||||
.get("/:uuid", (req, res) => res.redirect(`/v/${req.params.uuid}/`))
|
||||
|
||||
.use((err, req, res, next) => {
|
||||
console.error(err.stack);
|
||||
res.status(500).send("Something broke!");
|
||||
})
|
||||
|
||||
.listen(cfg.websrv.port, () => console.log(`fpaste listening on port ${cfg.websrv.port}`));
|
|
@ -47,5 +47,5 @@ export default express.Router()
|
|||
desc: r.reply ? `Reply to <a href="/${r.reply}/" class="descID">/${r.reply}/</a>` : r.desc || "No description.",
|
||||
rows: paste.split(/\r?\n/).length
|
||||
}});
|
||||
}).catch(err => res.send("paste not found " + JSON.stringify(err)));
|
||||
}).catch(err => res.send("paste not found"));
|
||||
});
|
Loading…
Reference in New Issue
Block a user