express-async-errors icon indicating copy to clipboard operation
express-async-errors copied to clipboard

is this tool a replcaement of asyncWrapper ?

Open issam-seghir opened this issue 2 years ago • 1 comments

is this tool a replacement of this :

function asyncWrapper(fn) {
	return function (req, res, next) {
		fn(req, res, next).catch(next);
	};
}


  app.get('/route', asyncWrapper(async (req, res, next) => {
  const data = await someAsyncOperation();
  res.json(data);
  }));

issam-seghir avatar Feb 11 '24 22:02 issam-seghir

yes. stop doing that.

AlanGreyjoy avatar May 09 '24 14:05 AlanGreyjoy