Example usage for java.io EOFException initCause

List of usage examples for java.io EOFException initCause

Introduction

In this page you can find the example usage for java.io EOFException initCause.

Prototype

public synchronized Throwable initCause(Throwable cause) 

Source Link

Document

Initializes the cause of this throwable to the specified value.

Usage

From source file:org.apache.hadoop.hbase.codec.BaseDecoder.java

private void rethrowEofException(IOException ioEx) throws IOException {
    boolean isEof = false;
    try {/*from  ww w .java  2 s .  c o  m*/
        isEof = this.in.available() == 0;
    } catch (Throwable t) {
        LOG.trace("Error getting available for error message - ignoring", t);
    }
    if (!isEof)
        throw ioEx;
    LOG.error("Partial cell read caused by EOF: " + ioEx);
    EOFException eofEx = new EOFException("Partial cell read");
    eofEx.initCause(ioEx);
    throw eofEx;
}

From source file:org.apache.hadoop.hbase.regionserver.wal.BinaryCompatibleBaseDecoder.java

private void rethrowEofException(IOException ioEx) throws IOException {
    boolean isEof = false;
    try {/*from   ww  w . ja v a2s  .  c  o m*/
        isEof = this.in.available() == 0;
    } catch (Throwable t) {
        LOG.trace("Error getting available for error message - ignoring", t);
    }
    if (!isEof)
        throw ioEx;
    if (LOG.isTraceEnabled()) {
        LOG.trace("Partial cell read caused by EOF", ioEx);
    }
    EOFException eofEx = new EOFException("Partial cell read");
    eofEx.initCause(ioEx);
    throw eofEx;
}