-
-
Save gleenk/4c058c10c98522dae9fbb51ccd5adc26 to your computer and use it in GitHub Desktop.
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
const functionA = async () => { | |
try { | |
// request something that resolves in a promise | |
} catch (error) { | |
throw new Error("Function A failed"); | |
} | |
} | |
const functionB = async () => { | |
try { | |
// request something that resolves in a promise | |
} catch (error) { | |
throw new Error("Function B failed"); | |
} | |
} | |
// child function returns different errors | |
const mainWrapper = async () => { | |
try { | |
await functionA(); | |
await functionB(); | |
} catch (error) { | |
throw error; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment