PrintWriter doesn't throw exceptions, so call checkError()

This commit is contained in:
zzz
2015-05-06 01:51:57 +00:00
parent 77c9a644ac
commit 2aafc23774
5 changed files with 13 additions and 0 deletions

View File

@ -87,6 +87,8 @@ abstract class PersistDHT {
out.println(ni.toPersistentString());
count++;
}
if (out.checkError())
throw new IOException("Failed write to " + file);
} catch (IOException ioe) {
if (log.shouldLog(Log.WARN))
log.warn("Error writing the DHT File", ioe);