I suggest you ...

Generic ITransientErrorDetectionStrategy

Hello,
ITransientErrorDetection.IsTransient accepts only an exception and it forces the code to throw exceptions even if not needed. I think it would help having an additional interface defined with a generic type, for example

public interface ITransientErrorDetection<T>
{
bool IsTransient(T error);
}

This way it would still work with the current implementation of retry policy, but also allow cases when the error is not an exception but an error code or message. An example of usage would be with HttpClient which doesn't throw an exception when a return status code is an error

Thoughts?

Thanks,
Pedro

4 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    PedroPedro shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base