public FatalRpcServerException(RpcErrorCodeProto errCode, String message) { this(errCode, new RpcServerException(message)); } @Override
/** * @param t the {@link java.lang.Throwable} to use to set * errorInfo * @param responseParams the {@link ResponseParams} instance to populate */ private void populateResponseParamsOnError(Throwable t, ResponseParams responseParams) { if (t instanceof UndeclaredThrowableException) { t = t.getCause(); } logException(Server.LOG, t, this); if (t instanceof RpcServerException) { RpcServerException rse = ((RpcServerException) t); responseParams.returnStatus = rse.getRpcStatusProto(); responseParams.detailedErr = rse.getRpcErrorCodeProto(); } else { responseParams.returnStatus = RpcStatusProto.ERROR; responseParams.detailedErr = RpcErrorCodeProto.ERROR_APPLICATION; } responseParams.errorClass = t.getClass().getName(); responseParams.error = StringUtils.stringifyException(t); // Remove redundant error class name from the beginning of the // stack trace String exceptionHdr = responseParams.errorClass + ": "; if (responseParams.error.startsWith(exceptionHdr)) { responseParams.error = responseParams.error.substring(exceptionHdr.length()); } }
Throwable t = (rse.getCause() != null) ? rse.getCause() : rse; final RpcCall call = new RpcCall(this, callId, retry); setupResponse(call, rse.getRpcStatusProto(), rse.getRpcErrorCodeProto(), null, t.getClass().getName(), t.getMessage()); sendResponse(call);
public void queueCall(Call call) throws IOException, InterruptedException { // external non-rpc calls don't need server exception wrapper. try { internalQueueCall(call); } catch (RpcServerException rse) { throw (IOException)rse.getCause(); } }
throw new RpcServerException( "WritableRpc version mismatch, client side version=" + call.getRpcVersion() + ", server side version=" RPC.RpcKind.RPC_WRITABLE, protocolName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protocolName); protoName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protoName); } else { // protocol supported but not the version that client wants throw new RPC.VersionMismatch(protoName, clientVersion,
if (e instanceof RpcServerException) { RpcServerException rse = ((RpcServerException)e); returnStatus = rse.getRpcStatusProto(); detailedErr = rse.getRpcErrorCodeProto(); } else { returnStatus = RpcStatusProto.ERROR;
Throwable t = (rse.getCause() != null) ? rse.getCause() : rse; final RpcCall call = new RpcCall(this, callId, retry); setupResponse(call, rse.getRpcStatusProto(), rse.getRpcErrorCodeProto(), null, t.getClass().getName(), t.getMessage()); sendResponse(call);
public FatalRpcServerException(RpcErrorCodeProto errCode, String message) { this(errCode, new RpcServerException(message)); } @Override
returnStatus = rse.getRpcStatusProto(); detailedErr = rse.getRpcErrorCodeProto(); } else { returnStatus = RpcStatusProto.ERROR;
public WrappedRpcServerException(RpcErrorCodeProto errCode, String message) { this(errCode, new RpcServerException(message)); } @Override
returnStatus = rse.getRpcStatusProto(); detailedErr = rse.getRpcErrorCodeProto(); } else { returnStatus = RpcStatusProto.ERROR;
public WrappedRpcServerException(RpcErrorCodeProto errCode, String message) { this(errCode, new RpcServerException(message)); } @Override
returnStatus = rse.getRpcStatusProto(); detailedErr = rse.getRpcErrorCodeProto(); } else { returnStatus = RpcStatusProto.ERROR;
public WrappedRpcServerException(RpcErrorCodeProto errCode, String message) { this(errCode, new RpcServerException(message)); } @Override
@Override public EmptyResponseProto error(RpcController unused, EmptyRequestProto request) throws ServiceException { throw new ServiceException("error", new RpcServerException("error")); }
@Override public EmptyResponseProto error(RpcController unused, EmptyRequestProto request) throws ServiceException { throw new ServiceException("error", new RpcServerException("error")); }
throw new RpcServerException( "WritableRpc version mismatch, client side version=" + call.getRpcVersion() + ", server side version=" RPC.RpcKind.RPC_WRITABLE, protocolName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protocolName); protoName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protoName); } else { // protocol supported but not the version that client wants throw new RPC.VersionMismatch(protoName, clientVersion,
throw new RpcServerException( "WritableRpc version mismatch, client side version=" + call.getRpcVersion() + ", server side version=" RPC.RpcKind.RPC_WRITABLE, protocolName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protocolName); protoName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protoName); } else { // protocol supported but not the version that client wants throw new RPC.VersionMismatch(protoName, clientVersion,
throw new RpcServerException( "WritableRpc version mismatch, client side version=" + call.getRpcVersion() + ", server side version=" RPC.RpcKind.RPC_WRITABLE, protocolName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protocolName); protoName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protoName); } else { // protocol supported but not the version that client wants throw new RPC.VersionMismatch(protoName, clientVersion,
throw new RpcServerException( "WritableRpc version mismatch, client side version=" + call.getRpcVersion() + ", server side version=" RPC.RpcKind.RPC_WRITABLE, protocolName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protocolName); protoName); if (highest == null) { throw new RpcServerException("Unknown protocol: " + protoName); } else { // protocol supported but not the version that client wants throw new RPC.VersionMismatch(protoName, clientVersion,