Skip to content

Commit

Permalink
Resolves alibaba#61: Enhance exception trace in Sentinel Dubbo Adapter
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Zhao <[email protected]>
  • Loading branch information
sczyh30 committed Aug 15, 2018
1 parent 820160d commit 49097fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 49097fa

Please sign in to comment.