Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async makeRequest function error-handling #72

Open
njsfield opened this issue Nov 4, 2016 · 0 comments
Open

async makeRequest function error-handling #72

njsfield opened this issue Nov 4, 2016 · 0 comments

Comments

@njsfield
Copy link

njsfield commented Nov 4, 2016

Great reusable implementation! As it is used in a waterfall chain, perhaps pass an Error to the callback if XMLHttpRequest doesn't exist. So instead of this;

  if (!httpRequest) {
    alert('Giving up :( Cannot create an XMLHTTP instance');
    return false;
  }

Use this

  if (!httpRequest) {
    cb('Giving up :( Cannot create an XMLHTTP instance');
  }

Otherwise the callback chain may not pick up on the 'return False' statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant