Skip to content

Instantly share code, notes, and snippets.

@jaandrle
Created June 18, 2021 20:37
Show Gist options
  • Save jaandrle/9714466561b86412a30dd7b0b73fea8c to your computer and use it in GitHub Desktop.
Save jaandrle/9714466561b86412a30dd7b0b73fea8c to your computer and use it in GitHub Desktop.
function debugPromise_(callback, ...args){
return callback(...args).catch(({ stack })=> {
const error= new Error(callback.name||String(callback));
error.stack+= '\n'+stack;
throw error;
});
};
//? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment