From 73dad95df57a6794ef876a989b64feb18909bc25 Mon Sep 17 00:00:00 2001 From: Clochix Date: Thu, 17 Dec 2015 10:31:54 +0100 Subject: [PATCH] Fix error handling on server side, refs #223 --- server/controllers/index.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/controllers/index.coffee b/server/controllers/index.coffee index 9c1f9663..40cc312d 100644 --- a/server/controllers/index.coffee +++ b/server/controllers/index.coffee @@ -8,14 +8,14 @@ module.exports.defaultRedirect = (req, res) -> module.exports.showRoutes = (req, res) -> res.send 200, router.getRoutes() -module.exports.resetRoutes = (req, res) -> +module.exports.resetRoutes = (req, res, next) -> router.reset (error) -> if error? next new Error error else res.send 200, success: true -module.exports.status = (req, res) -> +module.exports.status = (req, res, next) -> statusChecker.checkAllStatus (err, status) -> if err then next new Error err else res.send status