-
Notifications
You must be signed in to change notification settings - Fork 529
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
undici.stream ignores throwOnError #1753
Labels
Comments
PR welcome! |
Should do the same on undici.pipeline |
If no one else is looking, I've started to take a look at this. :) Have a WIP draft PR here, not finished yet. |
Hi, I implemented a fix. Can you take a look? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
undici.stream
/Dispatcher.stream
acceptsRequestOptions
which extendsDispatchOptions
which includesthrowOnError
to throw on 4xx and 5xx HTTP errors, but completely ignores it and calls the factory regardless of the status code.Reproducible By
Successfully creates an empty
httpbin_502.txt
(because httpbin.org sends empty body on/status
)Expected Behavior
Additional context
throwOnError
was introduced in feat: Option to throw on error status codes #1453request
:undici/lib/api/api-request.js
Line 95 in 0a7ba72
stream
lacks that code:undici/lib/api/api-stream.js
Line 92 in 0a7ba72
The text was updated successfully, but these errors were encountered: