Split out the method which performs the text error checking so we can
re-use it elsewhere.