seedlinux

find open source torrents and stats for people wishing to contribute bandwidth.
git clone git://git.beardyjay.co.uk/seedlinux
Log | Files | Refs | README | LICENSE

commit bf722127234fc9cd5e7b3d815023ca25c31a3e94
parent c5288cdec64f2653e37209caeac606d366e8a715
Author: Jay Scott <jay@jayscott.co.uk>
Date:   Sat,  1 Jul 2017 12:03:17 +0100

botched the error page, fixing

Diffstat:
Mapp.js | 5++++-
Mviews/error.pug | 2+-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app.js b/app.js @@ -38,13 +38,16 @@ app.use('/', index); app.use('/torrent/', torrent); app.use(function(req, res, next) { - res.status(404).render('error'); + var err = new Error('Not Found'); + err.status = 404; + next(err); }); app.use(function(err, req, res, next) { res.locals.message = err.message; res.locals.error = req.app.get('env') === 'development' ? err : {}; + res.status(err.status || 500); res.render('error'); }); diff --git a/views/error.pug b/views/error.pug @@ -12,4 +12,4 @@ html h2.ui.center.aligned.icon.header i.frown.icon .content - .sub.header= "Whoops! I think you are lost!" + .sub.header= "Whoops! I think you are lost! (" + error.status + ")"