Propagate the error further up the stack

Useful for error reporting and metrics.
This commit is contained in:
Alberto Fernández Capel 2018-06-06 12:49:02 +01:00
parent 8a317b5bfe
commit 16cb5e0d35

View file

@ -33,7 +33,7 @@ module.exports =
licenceName: licence.name
has_personal_subscription: subscription?
createInvite: (req, res)->
createInvite: (req, res, next)->
user = AuthenticationController.getSessionUser(req)
licence = SubscriptionDomainHandler.getLicenceUserCanJoin(user)
@ -42,6 +42,6 @@ module.exports =
TeamInvitesHandler.createDomainInvite user, licence, (err) ->
if err?
res.sendStatus 500
next(err)
else
res.sendStatus 200