add a function to get type error text