Do not understand what you mean.
Caused by improper design Partitioner partition index out of range.

    val partitioner = new Partitioner {
     override def numPartitions: Int = 2
     override def getPartition(key: Any): Int = key.hashCode() % 2
    }

`partitioner.getPartition(-1)` result  -1