下面列出了org.apache.zookeeper.KeeperException#initCause ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 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;
}
/**
* 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;
}