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

fix when response is empty #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jrunge
Copy link

@jrunge jrunge commented Jul 12, 2012

i was getting an error when the response from amazon came back empty. in that case, the parser returns result as null rather than undefined. checking for result.Errors then crashes node.

my fix was to check if data === '' before running the parser.

@miccolis
Copy link
Contributor

miccolis commented Jun 5, 2013

I suspect the root of this problem isn't that we get an empty response, but that we're not checking the http response code from AWS at all. There is another pull ( #48 ) that also has a partial fix here.

It seems like we should be able immediately error out on a status code > 500, and for others we should figure out a way attempt a parse when there is data, but error our with the status code if there isn't any or if it's not xml.

Does anyone know exactly when AWS would return a useful error in XML or when we could just use the http code?

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

Successfully merging this pull request may close these issues.

3 participants