Fix server hang issue

This commit is contained in:
John Lyon-Smith
2018-04-13 09:34:34 -07:00
parent 9cfb173d1b
commit bdc80c5b01
9 changed files with 86 additions and 49 deletions

View File

@@ -7,9 +7,9 @@ export { TeamRoutes } from "./TeamRoutes"
import createError from "http-errors"
export function catchAll(routeHandler) {
return (req, res, next) => {
return async (req, res, next) => {
try {
routeHandler(req, res, next)
await routeHandler(req, res, next)
} catch (err) {
if (err instanceof createError.HttpError) {
next(err)