if (isFieldIncluded(fields, "proxyContent")) {
httpResponse = proxyHandler.fetch(proxyUri);
}
} catch (IOException e) {
LOG.log(Level.INFO, "Failed to fetch resource " + proxyUri.getResource().toString(), e);
throw new ProcessingException("Error getting response content", HttpResponse.SC_BAD_GATEWAY);
} catch (GadgetException e) {
// TODO: Clean this log if it is too spammy
LOG.log(Level.INFO, "Failed to fetch resource " + proxyUri.getResource().toString(), e);
throw new ProcessingException("Error getting response content", HttpResponse.SC_BAD_GATEWAY);
}
try {
return createProxyResponse(uris.get(0), httpResponse, fields,
getProxyExpireMs(proxyUri, httpResponse));
} catch (IOException e) {
// Should never happen!
LOG.log(Level.WARNING, "Error creating proxy response", e);
throw new ProcessingException("Error getting response content",
HttpResponse.SC_INTERNAL_SERVER_ERROR);
}
}