distinguishing errors at end-of-file versus at some other location