Change error handling in TextImporter

Probably not the best way to do it, but it does seem to work.