org.apache.zookeeper.KeeperException#initCause ( )源码实例Demo

下面列出了org.apache.zookeeper.KeeperException#initCause ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hbase   文件: ZKWatcher.java
/**
 * Handles InterruptedExceptions in client calls.
 * @param ie the InterruptedException instance thrown
 * @throws KeeperException the exception to throw, transformed from the InterruptedException
 */
public void interruptedException(InterruptedException ie) throws KeeperException {
  interruptedExceptionNoThrow(ie, true);
  // Throw a system error exception to let upper level handle it
  KeeperException keeperException = new KeeperException.SystemErrorException();
  keeperException.initCause(ie);
  throw keeperException;
}
 
源代码2 项目: hbase   文件: ZKUtil.java
/**
 * Convert a {@link DeserializationException} to a more palatable {@link KeeperException}.
 * Used when can't let a {@link DeserializationException} out w/o changing public API.
 * @param e Exception to convert
 * @return Converted exception
 */
public static KeeperException convert(final DeserializationException e) {
  KeeperException ke = new KeeperException.DataInconsistencyException();
  ke.initCause(e);
  return ke;
}