0

I want to retry a query made with Refit. The issue is that Http Response does not have any signs of the error (e.g. status code), but the content itself only.

In my flow I have a custom Serializer that can distinguish a correct response and the error, deserialize it properly and then raise the error.

That means, the error is identified after the Http communication, so the HTTP policy is not involved here.

One of solutions would be to deserialize the content twice, which is weird. I'm wondering what other options do I have if I want to encapsulate this retry logic with Refit/Polly?

dr11
  • 5,166
  • 11
  • 35
  • 77
  • 1
    Could you please provide the related code as well to your question? – Peter Csala Aug 30 '23 at 17:47
  • I guess, you'll have to wrap the call to the Refit created client into a policy. Refit itself doesn't have a chance to know "good" from "bad" calls like that. – Fildor Aug 31 '23 at 05:59

0 Answers0