Reputation: 45
How can we catch two different exceptions (ex. from .lang
and .io
packages) in the same block of @Retryable
method. One, we return an IOException
and the other we retry the method.
@Retryable(value = {Exception.calss } ,maxAttempts = 3, backoff = @Backoff(delay = 3000))
public String getInfo() {
try {
//here we have an executive code that may have an IOException
} catch(Exception ex) {
//And here i would catch the Exception
throw new Exception();
}
}
Upvotes: 4
Views: 5771