The channelRead0 method in RpcHandler returnserror=null by default in its response.
However, in RpcProxy, response.isError() is used to determine whether an exception should be thrown.
The implementation of response.isError() is shown below:
public boolean isError(){
return error == null;
}
This can cause errors even when the operation is executed normally.
The
channelRead0
method inRpcHandler
returnserror=null
by default in its response. However, inRpcProxy
,response.isError()
is used to determine whether an exception should be thrown. The implementation ofresponse.isError()
is shown below:This can cause errors even when the operation is executed normally.
这里是中文翻译
在RpcHandler的channelRead0方法中,response默认返回error=null 但是在RpcProxy中,使用response.isError()来是否执行异常,这将会导致正常执行也出错