This behaviour is not documented in the javadoc for getAnyPod nor apparent from the source code.
However, the user of #getAnyPod did not provide any illegal arguments, and the exception is not helpful.
I propose raising a labeld RuntimeException instead.
OpenShift#getAnyPod
raisesIllegalArgumentException
when no pod is found. This is caused by the size of the results (0) being used to callRandom#nextInt
.nextInt
will raise IllegalArgumentException when called with non-positive number.This behaviour is not documented in the javadoc for
getAnyPod
nor apparent from the source code. However, the user of#getAnyPod
did not provide any illegal arguments, and the exception is not helpful.I propose raising a labeld RuntimeException instead.