Skip to content

Instantly share code, notes, and snippets.

@esprehn
Created August 5, 2020 06:13
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 esprehn/938dbd4271a2deb3fb30af8f03196ddc to your computer and use it in GitHub Desktop.
Save esprehn/938dbd4271a2deb3fb30af8f03196ddc to your computer and use it in GitHub Desktop.
<!doctype html>
<script>
function a() {
return new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('test')), 100);
});
}
function b() {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(), 100);
});
}
b().then(() => a());
onunhandledrejection = (e) => {
console.log(e.reason.stack);
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment