Will throw exception if $productIds is empty