Any reason the additional check here is necessary? raise_error(IndexError) is not specific enough?