Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
dc-java
Commits
3b6e4256
Commit
3b6e4256
authored
Jul 25, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检查unknownHostException错误
parent
c09887ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
AmazonAdProductJob.java
...d/src/main/java/com/bailuntec/job/AmazonAdProductJob.java
+3
-2
No files found.
data-base/base-sync-amazon-ad/src/main/java/com/bailuntec/job/AmazonAdProductJob.java
View file @
3b6e4256
...
@@ -165,14 +165,15 @@ public class AmazonAdProductJob extends PointJob {
...
@@ -165,14 +165,15 @@ public class AmazonAdProductJob extends PointJob {
private
void
handleReport
(
String
reportLocationUrl
,
JobAccountLog
jobAccountLog
,
AmazonAdAuth
amazonAdAuth
){
private
void
handleReport
(
String
reportLocationUrl
,
JobAccountLog
jobAccountLog
,
AmazonAdAuth
amazonAdAuth
){
Response
response
=
null
;
Response
response
=
null
;
GZIPInputStream
gzin
=
null
;
GZIPInputStream
gzin
=
null
;
try
{
Request
request
=
new
Request
.
Builder
()
Request
request
=
new
Request
.
Builder
()
.
url
(
reportLocationUrl
)
.
url
(
reportLocationUrl
)
.
get
()
.
addHeader
(
"Authorization"
,
amazonAdAuth
.
getAccessToken
())
.
addHeader
(
"Authorization"
,
amazonAdAuth
.
getAccessToken
())
.
addHeader
(
"Amazon-Advertising-API-ClientId"
,
amazonAdAuth
.
getClientId
())
.
addHeader
(
"Amazon-Advertising-API-ClientId"
,
amazonAdAuth
.
getClientId
())
.
addHeader
(
"Amazon-Advertising-API-Scope"
,
amazonAdAuth
.
getProfileId
())
.
addHeader
(
"Amazon-Advertising-API-Scope"
,
amazonAdAuth
.
getProfileId
())
.
addHeader
(
"Content-Type"
,
"application/json"
)
.
addHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
.
build
();
try
{
response
=
client
.
newCall
(
request
).
execute
();
response
=
client
.
newCall
(
request
).
execute
();
if
(
response
.
isSuccessful
())
{
if
(
response
.
isSuccessful
())
{
gzin
=
new
GZIPInputStream
(
response
.
body
().
byteStream
());
gzin
=
new
GZIPInputStream
(
response
.
body
().
byteStream
());
...
@@ -217,7 +218,7 @@ public class AmazonAdProductJob extends PointJob {
...
@@ -217,7 +218,7 @@ public class AmazonAdProductJob extends PointJob {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
error
(
"调用获取AmazonADReportLocation错误:"
,
e
);
log
.
error
(
"调用获取AmazonADReportLocation错误:"
,
e
);
jobAccountLog
.
setMessage
(
"调用获取AmazonADReportLocation错误:"
+
ExceptionUtil
.
transform
(
e
));
jobAccountLog
.
setMessage
(
reportLocationUrl
+
"调用获取AmazonADReportLocation错误:"
+
ExceptionUtil
.
transform
(
e
));
}
finally
{
}
finally
{
if
(
gzin
!=
null
)
{
if
(
gzin
!=
null
)
{
try
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment