raise error if get_record is not called with type equal to A or AAAA