Fix server hang issue
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user