Skip to content

Instantly share code, notes, and snippets.

@jnfrati
Last active May 20, 2020 00:57
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 jnfrati/89588545ae94ef9792a250c141452075 to your computer and use it in GitHub Desktop.
Save jnfrati/89588545ae94ef9792a250c141452075 to your computer and use it in GitHub Desktop.
asdasdasd
(async function(){
async function a(){
try{
// procesamiento vario
const res = await fetch();
return res.json();
}catch(error){
//catch error form fetch and from any process above
throw error
}
}
async function b(){
try{
// procesamiento vario
const resultA = await a();
// otro procesamiento
}catch(err){
// catch errors from function a, or any other above
throw err;
}
}
const resultDeB = await b();
//procesamiento con result de b
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment