public abstract class RpcUtil {
/**
- * @param result
- * @throws Throwable
+ * @param result rpc result
+ * @throws Exception exception thrown by method if rpc fails
*/
- public static void smokeRpc(RpcResult<?> result) throws Throwable {
+ public static void smokeRpc(RpcResult<?> result) throws Exception {
if (!result.isSuccessful()) {
Throwable firstCause = null;
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (RpcError error : result.getErrors()) {
if (firstCause != null) {
firstCause = error.getCause();
}
- sb.append("rpcError:").append(error.getCause().getMessage()).append(";");
+ sb.append("rpcError:").append(error.getCause().getMessage()).append(';');
}
throw new Exception(sb.toString(), firstCause);
}