Skip to content

Commit

Permalink
Add error log in case of IOException in ApiClient
Browse files Browse the repository at this point in the history
Signed-off-by: Stefano Guerrini <sguerrini@surveymonkey.com>
  • Loading branch information
Stefano Guerrini committed Sep 16, 2022
1 parent a21be10 commit 2a310e4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@
import org.apache.http.impl.conn.SystemDefaultRoutePlanner;
import org.apache.http.message.BasicHeader;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class ApiClient {

private static final Logger LOGGER = LoggerFactory.getLogger(ApiClient.class);

private final HttpClient httpClient;
private final String basePath;
private final Map<String, String> defaultHeaders;
Expand Down Expand Up @@ -59,6 +63,7 @@ private Response executeRequest(final Request request) throws RequestException {
try {
response = transformHttpResponse(httpClient.execute(httpRequest));
} catch (IOException exception) {
LOGGER.error("Request {} failed because {}", httpRequest, exception.getMessage());
throw new TransferException(exception, request);
}

Expand Down

0 comments on commit 2a310e4

Please sign in to comment.