Function to check the response immediately after receiving the status
and headers, before streaming of response body. The third argument is
the beginning of response body (typically first 1024 bytes). This is
used for throwing exceptions on non-success status codes by default
(set to
\_ _ _ -> Nothing if this behavior is not
desirable).
When the value this function returns is
Nothing, nothing will
happen. When it there is
HttpExceptionContent inside
Just, it will be thrown.
Throwing is better then just returning a request with non-2xx status
code because in that case something is wrong and we need a way to
short-cut execution (also remember that Req retries automatically on
request timeouts and such, so when your request fails, it's certainly
something exceptional). The thrown exception is caught by the library
though and is available in
handleHttpException.
Note: signature of this function was changed in the version
1.0.0.