Skip to content

Instantly share code, notes, and snippets.

@jsmithdev
Last active August 12, 2019 20:24
Show Gist options
  • Save jsmithdev/7e68514b2b73c223e0c44a402482b1e3 to your computer and use it in GitHub Desktop.
Save jsmithdev/7e68514b2b73c223e0c44a402482b1e3 to your computer and use it in GitHub Desktop.
async await try catch boilerplate function
/**
* @description Some example description
*
* @param {String} example: Another example description
*
* @returns {Object} result: Example of result
*/
async functionName(example){
try {
const result = await someOtherFuntion()
return result
}
catch(error){
console.error(error)
return error
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment