Handle errors when looking type