Skip to content

Commit

Permalink
fix: Exception propagation policy for Filtered retry
Browse files Browse the repository at this point in the history
  • Loading branch information
AmanKamani authored Dec 30, 2023
1 parent 01ff94d commit dca239c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package reactivefeign.retry;

import feign.ExceptionPropagationPolicy;
import org.reactivestreams.Publisher;
import reactor.core.Exceptions;
import reactor.core.publisher.Flux;
Expand All @@ -14,6 +15,8 @@ public class FilteredReactiveRetryPolicy implements ReactiveRetryPolicy {

private final ReactiveRetryPolicy retryPolicy;
private final Predicate<Throwable> toRetryOn;
private final ExceptionPropagationPolicy exceptionPropagationPolicy;


public static FilteredReactiveRetryPolicy notRetryOn(ReactiveRetryPolicy retryPolicy, Class<? extends Throwable>... errorClasses) {
return new FilteredReactiveRetryPolicy(retryPolicy,
Expand All @@ -22,8 +25,18 @@ public static FilteredReactiveRetryPolicy notRetryOn(ReactiveRetryPolicy retryPo
}

public FilteredReactiveRetryPolicy(ReactiveRetryPolicy retryPolicy, Predicate<Throwable> toRetryOn) {
this(retryPolicy, toRetryOn, retryPolicy.exceptionPropagationPolicy());
}

public FilteredReactiveRetryPolicy(ReactiveRetryPolicy retryPolicy, Predicate<Throwable> toRetryOn, ExceptionPropagationPolicy exceptionPropagationPolicy) {
this.retryPolicy = retryPolicy;
this.toRetryOn = toRetryOn;
this.exceptionPropagationPolicy = exceptionPropagationPolicy;
}

@Override
public ExceptionPropagationPolicy exceptionPropagationPolicy(){
return exceptionPropagationPolicy;
}

@Override
Expand Down

0 comments on commit dca239c

Please sign in to comment.