Catch errors when unable to read a line.