Implementation for type error convertion.