Handle TypeError instead of Attribute when no path is found