Skip to content

Commit

Permalink
When InputStream reads fail, propagate the exception
Browse files Browse the repository at this point in the history
FSTInputStream.readNextChunk throws on failure rather than
silently assuming the stream has completed.

In situations where it's necessary to power through failing
streams, a wrapped stream can be provided which reads until an
exception is thrown, then reports that it is finished.
  • Loading branch information
carterkozak committed May 30, 2017
1 parent d68e911 commit 9488050
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public void readNextChunk(InputStream in) {
} else {
fullyRead = true;
}
} catch (Exception iex) {
LOGGER.log(FSTLogger.Level.ERROR, "Failed to read next chunk, assuming fully read", iex);
fullyRead = true;
} catch (IOException e) {
LOGGER.log(FSTLogger.Level.ERROR, "Failed to read next chunk from InputStream", e);
throw new RuntimeException("Failed to read next chunk from InputStream", e);
}
}

Expand Down

0 comments on commit 9488050

Please sign in to comment.