diff options
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/async.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/middlewares/async.ts b/server/middlewares/async.ts index 3a1bdabb8..3d6e38809 100644 --- a/server/middlewares/async.ts +++ b/server/middlewares/async.ts | |||
@@ -13,7 +13,7 @@ function asyncMiddleware (fun: RequestPromiseHandler | RequestPromiseHandler[]) | |||
13 | return (req: Request, res: Response, next: NextFunction) => { | 13 | return (req: Request, res: Response, next: NextFunction) => { |
14 | if (Array.isArray(fun) === true) { | 14 | if (Array.isArray(fun) === true) { |
15 | return eachSeries(fun as RequestHandler[], (f, cb) => { | 15 | return eachSeries(fun as RequestHandler[], (f, cb) => { |
16 | Promise.resolve(f(req, res, cb)) | 16 | Promise.resolve(f(req, res, err => cb(err))) |
17 | .catch(err => next(err)) | 17 | .catch(err => next(err)) |
18 | }, next) | 18 | }, next) |
19 | } | 19 | } |