You would throw it in the same circumstances as the library methods ( BufferedReader.lines and Files.lines ) that currently do this: that is, when you complete an I / O exception that results from the operation after opening the file (open operation the file is still throwing an IOException). As for catching, it depends on your strategy for recovering I / O errors: in other words, do whatever you do to handle the IOEx wrapped exception in non-threaded code.
source share