Last active
May 20, 2020 00:57
-
-
Save jnfrati/89588545ae94ef9792a250c141452075 to your computer and use it in GitHub Desktop.
asdasdasd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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