Skip to content

Commit

Permalink
fix: Router - pass next to the handler to let the consumer decide wha…
Browse files Browse the repository at this point in the history
…t to do
  • Loading branch information
adrien2p committed Feb 25, 2022
1 parent e59ae3d commit 575c26f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/loaders/routes.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ function registerRoute(app: Express, route: RoutesInjectionRouterConfiguration):
path,
handlers.map(handler => {
return async (req: MedusaAuthenticatedRequest | Request, res: Response, next: NextFunction) => {
try {
await handler(req, res);
return next();
} catch (e) {
return next(e);
}
await handler(req, res, next);
};
})
);
Expand Down

0 comments on commit 575c26f

Please sign in to comment.