improve error reporting on IO exception