Skip to content

Instantly share code, notes, and snippets.

@qpfiffer
Created December 19, 2017 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qpfiffer/447ad09a2d011a59c187757010323a91 to your computer and use it in GitHub Desktop.
Save qpfiffer/447ad09a2d011a59c187757010323a91 to your computer and use it in GitHub Desktop.
correctlyLogErrors: (wrappedFunction) => {
var new_func = async (...functionArguments) => {
var retval = null
try {
retval = await wrappedFunction(...functionArguments)
} catch (error) {
console.log("ERROR THROWN:", error.message)
console.log("STACK:", error.stack)
throw(error)
}
return retval
}
return new_func
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment