CurlClient throws exception on HTTP request failed