Skip to content

Instantly share code, notes, and snippets.

@mtonc
Created September 14, 2022 18:12
Show Gist options
  • Save mtonc/9ed1152cf82ef123c61747ceb18fe59c to your computer and use it in GitHub Desktop.
Save mtonc/9ed1152cf82ef123c61747ceb18fe59c to your computer and use it in GitHub Desktop.
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