Commit 3b6e4256 by wutong

检查unknownHostException错误

parent c09887ad
......@@ -165,14 +165,15 @@ public class AmazonAdProductJob extends PointJob {
private void handleReport(String reportLocationUrl, JobAccountLog jobAccountLog, AmazonAdAuth amazonAdAuth){
Response response = null;
GZIPInputStream gzin = null;
Request request = new Request.Builder()
.url(reportLocationUrl)
.addHeader("Authorization", amazonAdAuth.getAccessToken())
.addHeader("Amazon-Advertising-API-ClientId", amazonAdAuth.getClientId())
.addHeader("Amazon-Advertising-API-Scope", amazonAdAuth.getProfileId())
.addHeader("Content-Type", "application/json")
.build();
try{
Request request = new Request.Builder()
.url(reportLocationUrl)
.get()
.addHeader("Authorization", amazonAdAuth.getAccessToken())
.addHeader("Amazon-Advertising-API-ClientId", amazonAdAuth.getClientId())
.addHeader("Amazon-Advertising-API-Scope", amazonAdAuth.getProfileId())
.addHeader("Content-Type", "application/json")
.build();
response = client.newCall(request).execute();
if (response.isSuccessful()) {
gzin = new GZIPInputStream(response.body().byteStream());
......@@ -217,7 +218,7 @@ public class AmazonAdProductJob extends PointJob {
}catch (Exception e){
e.printStackTrace();
log.error("调用获取AmazonADReportLocation错误:", e);
jobAccountLog.setMessage("调用获取AmazonADReportLocation错误:" + ExceptionUtil.transform(e));
jobAccountLog.setMessage(reportLocationUrl +"调用获取AmazonADReportLocation错误:"+ ExceptionUtil.transform(e));
} finally {
if(gzin != null) {
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment