Skip to content

Instantly share code, notes, and snippets.

@sahilrajput03
Created September 12, 2020 09:37
Show Gist options
  • Save sahilrajput03/1559de3ca485a23af3c101da2a3ca15a to your computer and use it in GitHub Desktop.
Save sahilrajput03/1559de3ca485a23af3c101da2a3ca15a to your computer and use it in GitHub Desktop.
exception catpuring with closures.
noExcepttion(() =>
new Promise((res, rej) => {
rej('error occured due to storm');
})
);
function noExcepttion(cb) {
cb().catch((t) => console.log(`::INFO::NOEXCEPTION:: ${t}`));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment