增加RpcRemoteException
This commit is contained in:
@@ -332,7 +332,7 @@ public final class SncpClient {
|
|||||||
return bsonConvert.convertFrom(action.handlerFuncParamIndex >= 0 ? Object.class : action.resultTypes, reader);
|
return bsonConvert.convertFrom(action.handlerFuncParamIndex >= 0 ? Object.class : action.resultTypes, reader);
|
||||||
} catch (InterruptedException | ExecutionException | TimeoutException e) {
|
} catch (InterruptedException | ExecutionException | TimeoutException e) {
|
||||||
logger.log(Level.SEVERE, actions[index].method + " sncp (params: " + jsonConvert.convertTo(params) + ") remote error", e);
|
logger.log(Level.SEVERE, actions[index].method + " sncp (params: " + jsonConvert.convertTo(params) + ") remote error", e);
|
||||||
throw new RuntimeException(actions[index].method + " sncp remote error", e);
|
throw new RpcRemoteException(actions[index].method + " sncp remote error", e);
|
||||||
} finally {
|
} finally {
|
||||||
bsonConvert.offerBsonReader(reader);
|
bsonConvert.offerBsonReader(reader);
|
||||||
}
|
}
|
||||||
@@ -403,7 +403,7 @@ public final class SncpClient {
|
|||||||
public void completed(Integer count, Void attachment2) {
|
public void completed(Integer count, Void attachment2) {
|
||||||
try {
|
try {
|
||||||
if (count < 1 && buffer.remaining() == buffer.limit()) { //没有数据可读
|
if (count < 1 && buffer.remaining() == buffer.limit()) { //没有数据可读
|
||||||
future.completeExceptionally(new RuntimeException(action.method + " sncp[" + conn.getRemoteAddress() + "] remote no response data"));
|
future.completeExceptionally(new RpcRemoteException(action.method + " sncp[" + conn.getRemoteAddress() + "] remote no response data"));
|
||||||
transport.offerBuffer(buffer);
|
transport.offerBuffer(buffer);
|
||||||
transport.offerConnection(true, conn);
|
transport.offerConnection(true, conn);
|
||||||
return;
|
return;
|
||||||
|
|||||||
33
src/org/redkale/service/RpcRemoteException.java
Normal file
33
src/org/redkale/service/RpcRemoteException.java
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.redkale.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供RPC协议使用
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* 详情见: https://redkale.org
|
||||||
|
*
|
||||||
|
* @author zhangjx
|
||||||
|
*/
|
||||||
|
public class RpcRemoteException extends RuntimeException {
|
||||||
|
|
||||||
|
public RpcRemoteException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public RpcRemoteException(String s) {
|
||||||
|
super(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RpcRemoteException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RpcRemoteException(Throwable cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user