Closed ntthaibk closed 1 year ago
What happens when you remove the handle(...)
line:
//.handle(DynamoDbException.class)
I'm guessing you're following the model on this page:
I think that sample code is demonstrating different possibilities rather than being a single model of how to do it.
I think that sample code is demonstrating different possibilities rather than being a single model of how to do it.
That's correct.
I wonder if there's a simple markdown way to make that clear, e.g.,
policyBuilder
.handle(ConnectException.class, SocketException.class);
// OR
.handleIf(e -> e instanceof ConnectException);
Note the semicolon on both alternatives.
thanks guys, it worked perfectly now.
P/S: as I'm working on it now, if you guys don't mind, I will send an MR to update the docs ^^
When I'm doing failsafe with this handleIf statement in the RetryPolicy builder
With other kind of Exception, e.g. IllegalStateException, RuntimeException with custom message, it can match with predicate and handle correctly. But for that DynamoDbException, regardless of the message, it always retry.
I don't know if we can do something to enhance so the predicate can catch the condition e.getMessage().contains("Rate exceeded"); correctly
Thank you guys