Skip to content
Permalink
Browse files
Enhance exception tracing in Sentinel Dubbo Adapter
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
  • Loading branch information
sczyh30 committed Sep 26, 2018
1 parent 3d580a1 commit 73d56474a629503654ce3f216fdb58ffe0d736a7
Showing 3 changed files with 13 additions and 5 deletions.
@@ -31,10 +31,8 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
<version>1.2.49</version>
<scope>test</scope>
</dependency>
</dependencies>


</project>
@@ -57,7 +57,13 @@ public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcExcept
ContextUtil.enter(resourceName);
interfaceEntry = SphU.entry(invoker.getInterface().getName(), EntryType.OUT);
methodEntry = SphU.entry(resourceName, EntryType.OUT);
return invoker.invoke(invocation);

Result result = invoker.invoke(invocation);
if (result.hasException()) {
// Record common exception.
Tracer.trace(result.getException());
}
return result;
} catch (BlockException e) {
return DubboFallbackRegistry.getConsumerFallback().handle(invoker, invocation, e);
} catch (RpcException e) {
@@ -63,7 +63,11 @@ public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcExcept
interfaceEntry = SphU.entry(interfaceName, EntryType.IN);
methodEntry = SphU.entry(resourceName, EntryType.IN, 1, invocation.getArguments());

return invoker.invoke(invocation);
Result result = invoker.invoke(invocation);
if (result.hasException()) {
Tracer.trace(result.getException());
}
return result;
} catch (BlockException e) {
return DubboFallbackRegistry.getProviderFallback().handle(invoker, invocation, e);
} catch (RpcException e) {

0 comments on commit 73d5647

Please sign in to comment.