Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created October 27, 2018 13:51
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 productioncoder/0b4e85bf1842e4a933de782b349b7c5d to your computer and use it in GitHub Desktop.
Save productioncoder/0b4e85bf1842e4a933de782b349b7c5d to your computer and use it in GitHub Desktop.
Youtube ignore promise failure
export function ignoreErrors(fn, ...args) {
return () => {
const ignoreErrorCallback = (response) => response;
return fn(...args).then(ignoreErrorCallback, ignoreErrorCallback);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment