I suggest asserting, not raising--it's an assumption of the function.  Callers should check before getting here.