Not your code, but looks like this also applies to `IOException`, when the stream is abruptly closed.