import org.apache.zookeeper.KeeperException; //导入方法依赖的package包/类

private static String getMessage(Throwable cause) {

if (cause instanceof KeeperException) {

KeeperException keeperException = (KeeperException) cause;

if (keeperException instanceof KeeperException.NoNodeException) {

return "Node does not exist: " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.NoChildrenForEphemeralsException) {

return "Ephemerals cannot have children: " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.NodeExistsException) {

return "Node already exists: " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.NotEmptyException) {

return "Node not empty: " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.NotReadOnlyException) {

return "Not a read-only call: " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.InvalidACLException) {

return "Acl is not valid : " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.NoAuthException) {

return "Authentication is not valid : " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.BadArgumentsException) {

return "Arguments are not valid : " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.BadVersionException) {

return "version No is not valid : " + keeperException.getPath();

} else if (keeperException instanceof KeeperException.ReconfigInProgress) {

return "Another reconfiguration is in progress -- concurrent " +

"reconfigs not supported (yet)";

} else if (keeperException instanceof KeeperException.NewConfigNoQuorum) {

return "No quorum of new config is connected and " +

"up-to-date with the leader of last commmitted config - try invoking reconfiguration after " +

"new servers are connected and synced";

}

}

return cause.getMessage();

}

badfail@qq.com+java_Java KeeperException.BadArgumentsException方法代码示例相关推荐

  1. drawimage的用法 java_Java Graphics.drawImage方法代码示例

    本文整理汇总了Java中javax.microedition.lcdui.Graphics.drawImage方法的典型用法代码示例.如果您正苦于以下问题:Java Graphics.drawImag ...

  2. findclass java_Java Context.findClass方法代码示例

    import jdk.nashorn.internal.runtime.Context; //导入方法依赖的package包/类 private static Class> simpleType ...

  3. Bytes int java_Java Bytes.readInt方法代码示例

    import net.openhft.chronicle.bytes.Bytes; //导入方法依赖的package包/类 @NotNull @Override public CharSequence ...

  4. object getkey java_Java S3Object.getKey方法代码示例

    import com.amazonaws.services.s3.model.S3Object; //导入方法依赖的package包/类 private S3Object decipher(GetOb ...

  5. fileset java_Java FileSet.iterator方法代码示例

    import org.apache.tools.ant.types.FileSet; //导入方法依赖的package包/类 public void execute() throws BuildExc ...

  6. x509代码实例java_Java X509AttributeCertificate.getIssuer方法代码示例

    import org.bouncycastle.x509.X509AttributeCertificate; //导入方法依赖的package包/类 /** * Parses the contents ...

  7. toolbar java_Java ToolBar.layout方法代码示例

    import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类 protected ToolBar createToolbar() { fina ...

  8. okhttputils java_Java OkHttpUtils.post方法代码示例

    import com.zhy.http.okhttp.OkHttpUtils; //导入方法依赖的package包/类 @Override public void performRequestAsyn ...

  9. getAttribute实例例java_Java ExifInterface.getAttribute方法代码示例

    import android.media.ExifInterface; //导入方法依赖的package包/类 public static void copyExif(ExifInterface or ...

最新文章

  1. Linux Yum命令(转)
  2. Android的消息机制(2)
  3. 201771010101 白玛次仁 《2018面向对象程序设计(Java)课程学习进度条》
  4. 1.4 Hive和数据库的比较
  5. Java Web 之Token+Cookie+Session
  6. 转载并学习实现三重DES加密解密代码(一)
  7. 书籍推荐-记这几年看的书
  8. asp.net 取windows的所有进程
  9. 三位数组的轴python_关于numpy数组轴的使用详解
  10. Docker启动失败提示【exec user process caused: exec format error】
  11. 人工智能——数据、信息与知识
  12. Spring mvc框架下使用kaptcha生成验证码
  13. Android开发之旅-Fragment和Activity之间onCreateOptionsMenu的联系
  14. Metamaterials perform image compression before light reaches the sensor(微波成像,拍摄与压缩同步进行)
  15. DBA_OBJECTS
  16. python语言开发环境配置理论_python语言开发环境配置
  17. 华为NP课程笔记23-VRRP
  18. 计算机组成原理乘法设计,资料计算机组成原理课设 定点补码一位乘法器的设计.doc...
  19. 使用WangEditor编辑器使用图片上传功能
  20. 大数据十道经典海量数据处理面试题与十个方法大总结

热门文章

  1. 嵌入式端音频开发(Unisound篇)之 7.1 蜂鸟M离线语音芯片简介
  2. Redis入门指南之复制
  3. 重命名技巧,支持多个文件夹快速重命名
  4. jQuery-获取/设置 属性(标准属性,自定义属性)和内容
  5. WS-Trust和WS-SecureConversation
  6. appemit使用mpvPlayer在谷歌chrome浏览器播放RTSP
  7. 2022纪中游记(进行中)
  8. 在宝塔部署出现require(): open_basedir restriction in effect. File解决办法
  9. Spring5 框架新功能(Webflux)
  10. MySQL分组查询,获取分组后数据