throw a DimensionMismatch instead of raising an error