Raise exceptions when attempting to assign invalid values to rows in Pattern class.