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

Throw if request canceled and received incomplete response #767

Merged
merged 7 commits into from Apr 5, 2019

Conversation

szmarczak
Copy link
Collaborator

Fixes #748

@szmarczak szmarczak changed the title Throw on incomplete response Throw if request canceled and received incomplete response Apr 2, 2019
source/as-promise.ts Outdated Show resolved Hide resolved
proxy._destroy = (error, callback) => {
// Stop transmitting data,
// so the stream won't have an `end` event.
output.destroy();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more elegant way would be to unpipe the response.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to care about it. It will end if no error is provided, otherwise it will throw before ending.

Co-Authored-By: szmarczak <36894700+szmarczak@users.noreply.github.com>
@szmarczak
Copy link
Collaborator Author

Thanks for the review @tobenna 🎉

It's very nice that you've had some time to take a look at this :)

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.

None yet

2 participants