Thinking errors are also known as cognitive distortions. It's when you have a pattern of thinking that sets a person up for failure.
An example of this type of self-deception would be "all or nothing" thinking. The belief that any small failure is the same as total failure, like getting a B (rather than an A) on a test. Another thinking error is the belief that any failure sets the tone for all future life events, such as failing the bar exam on your first try and giving up entirely, rather than just preparing to take it again.