Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
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
openSource
apollo
Commits
26b44e2f
Commit
26b44e2f
authored
Dec 27, 2016
by
张乐
Committed by
GitHub
Dec 27, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #503 from nobodyiam/client-log-error-as-event
log error as event for apollo-client
parents
67efe969
c24f2a85
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
0 deletions
+8
-0
AbstractConfigRepository.java
.../framework/apollo/internals/AbstractConfigRepository.java
+1
-0
ConfigServiceLocator.java
...trip/framework/apollo/internals/ConfigServiceLocator.java
+2
-0
LocalFileConfigRepository.java
...framework/apollo/internals/LocalFileConfigRepository.java
+1
-0
RemoteConfigLongPollService.java
...amework/apollo/internals/RemoteConfigLongPollService.java
+1
-0
RemoteConfigRepository.java
...ip/framework/apollo/internals/RemoteConfigRepository.java
+3
-0
No files found.
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/AbstractConfigRepository.java
View file @
26b44e2f
...
...
@@ -23,6 +23,7 @@ public abstract class AbstractConfigRepository implements ConfigRepository {
sync
();
return
true
;
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
logger
.
warn
(
"Sync config failed, will retry. Repository {}, reason: {}"
,
this
.
getClass
(),
ExceptionUtil
.
getDetailMessage
(
ex
));
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/ConfigServiceLocator.java
View file @
26b44e2f
...
...
@@ -14,6 +14,7 @@ import com.ctrip.framework.apollo.exceptions.ApolloConfigException;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.spi.Transaction
;
import
com.ctrip.framework.apollo.util.ConfigUtil
;
import
com.ctrip.framework.apollo.util.ExceptionUtil
;
import
com.ctrip.framework.apollo.util.http.HttpRequest
;
import
com.ctrip.framework.apollo.util.http.HttpResponse
;
import
com.ctrip.framework.apollo.util.http.HttpUtil
;
...
...
@@ -122,6 +123,7 @@ public class ConfigServiceLocator implements Initializable {
logConfigServicesToCat
(
services
);
return
;
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
exception
=
ex
;
}
finally
{
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java
View file @
26b44e2f
...
...
@@ -141,6 +141,7 @@ public class LocalFileConfigRepository extends AbstractConfigRepository
m_fileProperties
=
this
.
loadFromLocalCacheFile
(
m_baseDir
,
m_namespace
);
transaction
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
exception
=
ex
;
//ignore
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollService.java
View file @
26b44e2f
...
...
@@ -180,6 +180,7 @@ public class RemoteConfigLongPollService implements Initializable {
transaction
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Throwable
ex
)
{
lastServiceDto
=
null
;
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
long
sleepTimeInSecond
=
m_longPollFailSchedulePolicyInSecond
.
fail
();
logger
.
warn
(
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java
View file @
26b44e2f
...
...
@@ -18,6 +18,7 @@ import com.ctrip.framework.apollo.exceptions.ApolloConfigStatusCodeException;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.spi.Transaction
;
import
com.ctrip.framework.apollo.util.ConfigUtil
;
import
com.ctrip.framework.apollo.util.ExceptionUtil
;
import
com.ctrip.framework.apollo.util.http.HttpRequest
;
import
com.ctrip.framework.apollo.util.http.HttpResponse
;
import
com.ctrip.framework.apollo.util.http.HttpUtil
;
...
...
@@ -213,9 +214,11 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
statusCodeException
=
new
ApolloConfigStatusCodeException
(
ex
.
getStatusCode
(),
message
);
}
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
statusCodeException
));
transaction
.
setStatus
(
statusCodeException
);
exception
=
statusCodeException
;
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
exception
=
ex
;
}
finally
{
...
...
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