Created
September 14, 2022 18:12
-
-
Save mtonc/9ed1152cf82ef123c61747ceb18fe59c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const catchAsync = (fn) => { | |
try { | |
return async (...args) => await fn(...args); | |
} catch (err) { | |
console.error(err); | |
} | |
}; | |
export default catchAsync; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment