catch eof errror