When we close the CloseableHttpResponse object using its close() method, what would we need to do if there was an error trying to close it? In what cases would this method throw an IOException?
Here is my final block:
finally {
if(response != null) {
try {
response.close();
} catch (IOException e) {
logger.error("Error while trying to close response", e);
}
}
}
Is there any more code I'd need to include to handle the IOException we could get when calling close()?