Skip to content

Does undici take care of consuming the response body if throwOnError: true? #3440

Closed Answered by metcoder95
schaable asked this question in Q&A
Discussion options

You must be logged in to vote

👋

Yes, if the request fails with a range grater or equal than 400, Undici will read the body and attach it to the Error's properties.

It is worth mentioning that this will change in the future major. If you want to preserve this behaviour, you'll need to use an interceptor instead.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@paymog
Comment options

Answer selected by schaable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants