Better error message for generic getter.