use of uk.nhs.adaptors.scr.exceptions.ScrBaseException in project summary-care-record-api by NHSDigital.
the class SpineHttpClient method sendRequest.
@SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE", justification = "SpotBugs issue with fix not yet released https://github.com/spotbugs/spotbugs/pull/1248")
@LogExecutionTime
public <T> Response<T> sendRequest(HttpRequestBase request, ResponseHandler<? extends Response<T>> responseHandler) {
LOGGER.debug("Attempting to send SPINE request: {}", request.getRequestLine().toString());
try {
LOGGER.info("Leased connections: " + clientConnectionManager.getTotalStats().getLeased());
LOGGER.info("Available connections: " + clientConnectionManager.getTotalStats().getAvailable());
return client.execute(request, responseHandler, HttpClientContext.create());
} catch (IOException e) {
LOGGER.error("Error while sending SPINE request", e);
throw new ScrBaseException("Unexpected exception while sending Spine request", e);
}
}
Aggregations