Raise an error when trying to record a variable that is not a double