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

Getting "headers already sent" when fetch action returns error. #18

Closed
tobice opened this issue Oct 1, 2014 · 4 comments
Closed

Getting "headers already sent" when fetch action returns error. #18

tobice opened this issue Oct 1, 2014 · 4 comments
Labels

Comments

@tobice
Copy link

tobice commented Oct 1, 2014

I think the problem is at this line: https://github.com/yahoo/fetchr/blob/master/libs/fetcher.js#L108

In case of error, status 400 is set and response body is sent, but the function just goes on and four lines later it tries to send the response body again.

By the way, could you change it that the whole err object could be sent back instead of the general "request failed" message?

@mridgway
Copy link
Collaborator

mridgway commented Oct 1, 2014

Yikes, yeah that needs to be fixed.

And yes, we need to clean up the error logic here.

@tobice tobice changed the title Getting "headers already sent" when fetch action return error. Getting "headers already sent" when fetch action returns error. Oct 1, 2014
@tobice
Copy link
Author

tobice commented Oct 1, 2014

That was quick :) It's good to hear that someone's working on that.

@mridgway
Copy link
Collaborator

mridgway commented Oct 1, 2014

We'll get the return fixed immediately and @mtscout6 is working on related status code changes in #17

@mridgway
Copy link
Collaborator

mridgway commented Oct 1, 2014

The bug should be fixed in version 0.3.2.

@mridgway mridgway added the bug label Oct 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants