question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to ignore any exception with Polly?

See original GitHub issue

HI!

I have code like this:

try
{
    DoSomething();
} catch (Exception) {}

How to do it with Polly? It means I want to try to execute some method and not handle any exception when it fails - just keep running.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
reisenbergercommented, Jul 11, 2019

Why not to realize some method like Policy.Handle<Exception>().NotThrow() without that debugger dances?

Because it is not possible. As the article and stackoverflow question I linked explain, this is entirely a debugger artefact. The way the debugger behaves here is not something that any code within Polly could change. But we do provide guidance on how to improve your debugging experience. The wiki article I linked explains in detail how to stop these debugger dances, if you don’t like them.

0reactions
reisenbergercommented, Jul 13, 2019

@moabtools No problem! Closing as think we have answered the questions, but post or open a new issue if you need anything else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Polly Retry All Exceptions Except Specific Condition
Is there a way in Polly to retry all exceptions apart from those which are specified.. for example: var p = Policy ....
Read more >
Polly Retries and Exceptions in .Net 6 - AlignedDev
I answered a question on StackOverflow in November, 2018. using Polly; var retry = Policy .Handle<Exception>() .WaitAndRetry(2, retryAttempt => ...
Read more >
Exception handling policies with Polly | My Memory
A policy basically defines which exceptions to handle, what to do when an exception occurs and you can tell Polly to retry the...
Read more >
Cancelling a Polly Retry policy - Chris Roberts
Click “Start Policy”, you'll see it retry a couple of times and print out the captured exception message. Now click the “Stop Policy ......
Read more >
Use Polly to retry requests in C# - Duong's Blog
The Polly library is my go-to choice whenever I need to retry my HTTP requests. In today's article, we will see how it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found