Skip to content

Instantly share code, notes, and snippets.

@jillro
Created June 7, 2017 10:13
Show Gist options
  • Select an option

  • Save jillro/d9be91e27568e42731e6505ba291bfb4 to your computer and use it in GitHub Desktop.

Select an option

Save jillro/d9be91e27568e42731e6505ba291bfb4 to your computer and use it in GitHub Desktop.
A one line wrapper to use async function in express.
const wrap = fn => (...args) => fn(...args).catch(args[2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment