Skip to content

Commit

Permalink
Merge pull request #209 from GetFeedback/add-logs-api-client
Browse files Browse the repository at this point in the history
Add error log in case of IOException in ApiClient
  • Loading branch information
Stefano Guerrini authored Sep 16, 2022
2 parents a21be10 + 8a74c25 commit 232e150
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/dependency-check-suppression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@
<packageUrl regex="true">^pkg:maven/org\.yaml/snakeyaml@.*$</packageUrl>
<cve>CVE-2022-25857</cve>
<cve>CVE-2022-38752</cve>
<cve>CVE-2022-38749</cve>
<cve>CVE-2022-38751</cve>
<cve>CVE-2022-38750</cve>
</suppress>
</suppressions>
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 232e150

Please sign in to comment.