We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 206dae1 commit 1a46bc0Copy full SHA for 1a46bc0
shared/utilities/catchAsync.js shared/utilities/asyncErrorHandler.jsshared/utilities/catchAsync.js renamed to shared/utilities/asyncErrorHandler.js
@@ -1,7 +1,7 @@
1
-const catchAsync = (fn) => (req, res, next) => {
+const asyncErrorHandler = (fn) => (req, res, next) => {
2
return Promise.resolve(fn(req, res, next)).catch((err) => {
3
next(err)
4
})
5
}
6
7
-module.exports = catchAsync
+module.exports = asyncErrorHandler
shared/utilities/index.js
@@ -1,4 +1,4 @@
module.exports.APIError = require('./APIError')
-module.exports.catchAsync = require('./catchAsync')
+module.exports.asyncErrorHandler = require('./asyncErrorHandler')
module.exports.pick = require('./pick')
module.exports.validate = require('./validate')
0 commit comments