guohao commented on issue #8363:
URL: https://github.com/apache/dubbo/issues/8363#issuecomment-897533563
Scenario1 : Non-Protobuf
Exception will be serialized and rethrowed at client side.
Scenario2 : Protobuf
Serialization of origin exception is not supported, insteadly a
`TripleRpcException` will be returned. Users can return and get custom error
code in response's attachments like this
```java
@Activate(group = {CommonConstants.CONSUMER})
public class BizErrorCodeClientFilter implements ClusterFilter,
BaseFilter.Listener {
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws
RpcException {
return invoker.invoke(invocation);
}
@Override
public void onResponse(Result appResponse, Invoker<?> invoker,
Invocation invocation) {
appResponse.getObjectAttachment("biz-err-code");
}
@Override
public void onError(Throwable t, Invoker<?> invoker, Invocation
invocation) {
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]