-
Notifications
You must be signed in to change notification settings - Fork 285
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
Docs should mention that must read or resume knox responses in Node 0.10.x #192
Comments
Hmm, what else would you be doing with them besides consuming them? |
@domenic assuming that everything went awesome (no Digging through the source its apparent that you shouldn't be assuming that eg. you should be checking the status code etc to ensure your upload worked - but that burned me as I copied and pasted the examples and didn't dig into the source until I saw the errors. |
I guess I'm not sure how this could cause It'd probably be good to expand the doc examples to do status code checking though. It sounds more likely that you got some kind of error response and never realized?? Then again you said that adding |
@domenic so looking back at my codes, I added my own error handler to catch these errors as they were being raised after knox removed it's own error handler from the request object. https://github.com/johnboxall/betty/blob/master/lib/client.js#L24 The issue I mentioned and it's related gist are exactly the behaviour I was seeing: nodejs/node-v0.x-archive#5545 (comment) The fix Isaacs recommends is to |
Ahh, the trick was the line
I didn't quite understand what the problem was with not having |
When using knox to put ~800 files, I would seemingly randomly get an
ENOTFOUND
error.Searching lead me to this comment:
nodejs/node-v0.x-archive#5545 (comment)
Which then led me to the the docs:
http://nodejs.org/api/http.html#http_class_http_clientrequest
I realized I was not consuming the responses I was receiving from S3! Now I've changed my put callbacks to call
res.resume()
and things are flying.I believe that this issue was introduced with new style streams as the 0.8.25 docs don't seem to mention it: http://nodejs.org/docs/v0.8.25/api/all.html#all_class_http_clientrequest
Awesome lib thanks!
The text was updated successfully, but these errors were encountered: