In mutiny, I want to retry a Uni<> when it fails, but the only condition to generate a failure is to throw an exception? #574
-
I was wondering, do I have to use an exception to determine when onFailure() occurs? Do I have to throw an exception to trigger a retry when the http request returns a non-200 status code, which is the effect I want? |
Beta Was this translation helpful? Give feedback.
Answered by
cescoffier
May 27, 2021
Replies: 1 comment 3 replies
-
What you can do is the following:
The idea is to forward a failure if the response is not a 200 and recover (retry) in that case. If would retry for every failure. You can limit the retry by failing with a specific exception and use |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
jiayaoO3O
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What you can do is the following:
The idea is to forward a failure if the response is not a 200 and recover (retry) in that case. If would retry for every failure. You can limit the retry by failing with a specific exception and use
onFailure(MySpecificException.class).retry()...