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

http-client, callback calls cause TypeError #172

Open
Perdjesk opened this issue May 22, 2013 · 0 comments
Open

http-client, callback calls cause TypeError #172

Perdjesk opened this issue May 22, 2013 · 0 comments

Comments

@Perdjesk
Copy link

Following functions in http-client.js are likely to throw an exception when an error occured in underlying call of httpClient.request:

  • HttpClient.prototype.buckets
  • HttpClient.prototype.getBucket

Because when an error is detected in httpClient.request the callback is called as following:

 callback(err);

and in those two functions, callbacks are implemented as:

meta.callback = function(err, data, _meta) { callback(err, data.buckets, _meta) }

Something like the following could be added in callback:

data = data ? data.buckets : undefined;
callback(err, data, _meta);

Exact error is:
TypeError: Cannot read property 'buckets' of undefined

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