Use catchIOError instead of the more generic catch for EOF error.