class ErrorProcessingFilter implements ClientResponseFilter {

    @Override
    public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
        if (responseContext.getStatus() == SC_BAD_REQUEST) {
            throw new ClcBadRequestException(responseContext);
        } else if (responseContext.getStatus() >= 400) {
            throw new ClcHttpClientException(responseContext);
        }
    }

}