Skip to content

Commit 1a46bc0

Browse files
committed
refactor: rename catchAsync
1 parent 206dae1 commit 1a46bc0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const catchAsync = (fn) => (req, res, next) => {
1+
const asyncErrorHandler = (fn) => (req, res, next) => {
22
return Promise.resolve(fn(req, res, next)).catch((err) => {
33
next(err)
44
})
55
}
66

7-
module.exports = catchAsync
7+
module.exports = asyncErrorHandler

shared/utilities/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports.APIError = require('./APIError')
2-
module.exports.catchAsync = require('./catchAsync')
2+
module.exports.asyncErrorHandler = require('./asyncErrorHandler')
33
module.exports.pick = require('./pick')
44
module.exports.validate = require('./validate')

0 commit comments

Comments
 (0)