-
Notifications
You must be signed in to change notification settings - Fork 705
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
Don't throw IllegalStateException when no instances are available #478
Comments
Not sure I agree. From
I definitely wouldn't use
Neither one of those things happens when no instances are available. How often do you deal with no instances available? |
No instances being available is a client-side HTTP error. If you chose one you thought was available but it turned out not to be, a
That's not really relevant. When it does happen I need to be able to deal with it appropriately, which already happens for non-load-balanced |
I can be convinced of |
The key term is "HTTP errors". Not having any instances available doesnt seem like an HTTP error to me. |
@ryanjbaxter have you looked at how Spring already uses it? |
Sorry I was consumed by the terminology "instances". When using a plain |
Well in a plain In this one specific case you get |
In the 1st case, you are actually trying to create a connection (there's no notion of instances). In the 2nd it never gets to that point. We've marked it for team discussion. The arguing of semantics here isn't helping. |
I'm not arguing semantics, I'm pointing out practical reasons why this should be changed. |
Has this been discussed yet within the spring-cloud team? I also believe a more specialised runtime exception would be appropriate here. ISE is too general for this case. |
There are two steps a new exception and catching and exception in the |
Once it comes out of a
RestTemplate
it should be aRestClientException
, preferably aResourceAccessException
, so it can be handled consistently.At the moment it is annoying to deal with.
The text was updated successfully, but these errors were encountered: