Throw an exception when adding invalid priors.