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

Response in ResponseError of withDecoder combinator cannot be consumed #360

Closed
StefanoMagrassi opened this issue Jan 26, 2021 · 0 comments · Fixed by #361
Closed

Response in ResponseError of withDecoder combinator cannot be consumed #360

StefanoMagrassi opened this issue Jan 26, 2021 · 0 comments · Fixed by #361
Assignees
Milestone

Comments

@StefanoMagrassi
Copy link
Contributor

Description

The Response object (carried by response field) in ResponseError raised by withDecoder combinator cannot be consumed (namely using .text(), .json() etc. methods) because the body stream is already read (the combinator acts on a the "response side" of a fetch request).

Look at the spec for further information.

Current behavior

If you try to access to response's content of a ResponseError returned when withDecoder is applied a TypeError: body used already is thrown.

Expected behavior

The response's content should be readable also from withDecoder's ResponseError.

Environment:

  • OS: all
  • Browser: all
  • Node/npm version: all
  • Typescript version: all

Additional information

This bug has to be avoided also for other future combinators that act on "response side" of a request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant