Code Monkey home page Code Monkey logo

Comments (8)

dsyer avatar dsyer commented on May 22, 2024 1

Fixed in #108

from spring-retry.

garyrussell avatar garyrussell commented on May 22, 2024

My interpretation is that only when both exclude and include are missing it retries all exceptions.

That's what the javadoc says

/**
 * Exception types that are retryable. Synonym for includes(). Defaults to empty (and
 * if excludes is also empty all exceptions are retried).
 * @return exception types to retry
 */
Class<? extends Throwable>[] value() default {};

/**
 * Exception types that are retryable. Defaults to empty (and if excludes is also
 * empty all exceptions are retried).
 * @return exception types to retry
 */
Class<? extends Throwable>[] include() default {};

/**
 * Exception types that are not retryable. Defaults to empty (and if includes is also
 * empty all exceptions are retried).
 * @return exception types to retry
 */
Class<? extends Throwable>[] exclude() default {};

The SimpleRetryPolicy now supports an "all except" option, but it's not currently supported via the annotation.

from spring-retry.

garyrussell avatar garyrussell commented on May 22, 2024

You can, of course, use

@Retryable(include = RuntimeException.class, exclude = IllegalArgumentException.class)

from spring-retry.

 avatar commented on May 22, 2024

I get all that, but why not

@retryable(exclude = IllegalArgumentException.class) and include by default any other exception, is there a technical limitation of doing this?

from spring-retry.

garyrussell avatar garyrussell commented on May 22, 2024

No, there's no technical reason, it's just the way it was implemented.

from spring-retry.

 avatar commented on May 22, 2024

I guess this is not a bug but an enhancement request.

from spring-retry.

hyojinbae avatar hyojinbae commented on May 22, 2024

Is this already fixed?
Im using spring-retry 1.1.2.RELEASE with Spring boot 1.5.10.RELEASE
and not reproduce.

from spring-retry.

xak2000 avatar xak2000 commented on May 22, 2024

What the purpose of exclude option, if any exception is also excluded by default when exclude is not empty?

So

@Retryable(exclude = IllegalArgumentException.class)

actualy excludes ALL exceptions, not just IllegalArgumentException.

I think this is very confusing behavior.

I understand that it could be a breaking change, but current behavior has no sense. It works as expected (expected not from documentation perspective, but from common sense perspective) only when include = Throwable.class is also present.

Maybe consider this change for 2.0, if you think this would be too breaking change for 1.x.

from spring-retry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.