Skip to content

Commit

Permalink
Fix error handling on server side, refs cozy#223
Browse files Browse the repository at this point in the history
  • Loading branch information
clochix authored and paultranvan committed Apr 4, 2016
1 parent 757f1b3 commit 73dad95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/controllers/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 73dad95

Please sign in to comment.