Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop raising illegalArgumentException when no pod found in #getAnyPod #563

Open
vsalbaba opened this issue Apr 5, 2024 · 0 comments
Open
Labels

Comments

@vsalbaba
Copy link

vsalbaba commented Apr 5, 2024

OpenShift#getAnyPod raises IllegalArgumentException when no pod is found.
This is caused by the size of the results (0) being used to call Random#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants