Skip to content

Commit ca62cc6

Browse files
committed
(docs) update readme with usage for RetryException
1 parent f3459fd commit ca62cc6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

riptide-failsafe/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,23 @@ RetryPolicy.<ClientHttpResponse>builder()
7777
.build();
7878
```
7979

80+
By default, you can use RetryException in your routes to retry the request:
81+
82+
```java
83+
retryClient.get()
84+
.dispatch(
85+
series(), on(CLIENT_ERROR).call(
86+
response -> {
87+
if (specificCondition(response)) {
88+
throw new RetryException(response); // we will retry this one
89+
} else {
90+
throw new AnyOtherException(response); // we wont retry this one
91+
}
92+
}
93+
)
94+
).join()
95+
```
96+
8097
Failsafe supports dynamically computed delays using a custom function.
8198

8299
Riptide: Failsafe offers implementations that understand:

0 commit comments

Comments
 (0)