Incorrect statements about exceptions in the Wiki for Stream and for Timeouts
-
https://honeyryderchuck.gitlab.io/httpx/wiki/Stream says
# NOT POSSIBLE response = http.get("https://nghttp2.orh/httpbin/status/404", stream: true) # HTTPX::HTTPError raisedbut this seems to be false; the exception is only raised on calling
response.each(or.each_linewhich calls.each). -
https://honeyryderchuck.gitlab.io/httpx/wiki/Timeouts several times says expiring timeouts raise exceptions, but in fact they seem to return
HTTPX::ErrorResponses wrapping those exceptions (unlessstream: trueis used, of course):[6] pry(main)> response = HTTPX.get("https://google.com", timeout: { request_timeout: 0.001 }) => #<HTTPX::ErrorResponse:0x00007ffabfab7310 @error=#<HTTPX::RequestTimeoutError: Timed out after 0.001 seconds>,
Edited by Alexey Romanov