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

Error messages not helpful in certain situations #44

Open
makenai opened this issue Dec 7, 2014 · 1 comment
Open

Error messages not helpful in certain situations #44

makenai opened this issue Dec 7, 2014 · 1 comment

Comments

@makenai
Copy link
Contributor

makenai commented Dec 7, 2014

While setting up at RobotsConf, I got:

'Error code 400 - error connecting to cloud' when my Spark token was expired.

Then, 'Error code 404 - error connecting to cloud' when Spark returned a 'variable not found' error (not displayed - had to dump the error body out) indicating I had an old or nonexistent version of VoodooSpark installed.

These could return some more useful hints / messages.

@makenai
Copy link
Contributor Author

makenai commented Dec 7, 2014

Both of the errors happened around line 280 in spark.js:

  if (res.statusCode === 200) {
      var data = JSON.parse(body);
      if (data.error) {
        err = "ERROR: " + data.code + " " + data.error_description;
      }
      if (handler) {
        handler(err, data);
      }
  } else {
   // Please consider adding the body message below
    err = errors.cloud + ": code: " + res.statusCode;
    if (handler) {
      handler(new Error(err));
    } else {
      throw new Error(err);
    }
  }

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