Resolves #61: Enhance exception trace in Sentinel Dubbo Adapter
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
This commit is contained in:
parent
820160d542
commit
49097fa45c
|
|
@ -57,7 +57,13 @@ public class SentinelDubboConsumerFilter extends AbstractDubboFilter implements
|
||||||
ContextUtil.enter(resourceName);
|
ContextUtil.enter(resourceName);
|
||||||
interfaceEntry = SphU.entry(invoker.getInterface().getName(), EntryType.OUT);
|
interfaceEntry = SphU.entry(invoker.getInterface().getName(), EntryType.OUT);
|
||||||
methodEntry = SphU.entry(resourceName, 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) {
|
} catch (BlockException e) {
|
||||||
return DubboFallbackRegistry.getConsumerFallback().handle(invoker, invocation, e);
|
return DubboFallbackRegistry.getConsumerFallback().handle(invoker, invocation, e);
|
||||||
} catch (RpcException e) {
|
} catch (RpcException e) {
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,11 @@ public class SentinelDubboProviderFilter extends AbstractDubboFilter implements
|
||||||
interfaceEntry = SphU.entry(interfaceName, EntryType.IN);
|
interfaceEntry = SphU.entry(interfaceName, EntryType.IN);
|
||||||
methodEntry = SphU.entry(resourceName, EntryType.IN, 1, invocation.getArguments());
|
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) {
|
} catch (BlockException e) {
|
||||||
return DubboFallbackRegistry.getProviderFallback().handle(invoker, invocation, e);
|
return DubboFallbackRegistry.getProviderFallback().handle(invoker, invocation, e);
|
||||||
} catch (RpcException e) {
|
} catch (RpcException e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue