0

In Visual Studio there is a possibility to mute an exception when it happens in particular place, e.g. We are aware that there is some NullRefereneceException in Calculator.cs and we still want to catch those types of exceptions when thrown from all other places in code, but Calculator.cs.

How it looks like in VS: enter image description here

Is such a feature available in Rider?

Korfu
  • 673
  • 5
  • 20

2 Answers2

1

I wasn't able to find a solution to your question.

The only thing I found is to not break on a specific exception type - but that's unrelated to the line.
For example, let's take the following code:

public class OtherClass
{
    public void ThrowNullReferenceException()
    {
        try
        {
            throw new NullReferenceException();
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
            throw;
        }
    }
}

With the following Exception Settings, the handled NullReferenceException gets swallowed: enter image description here

Maybe you can get in contact with Rider support.

mu88
  • 4,156
  • 1
  • 23
  • 47
  • 1
    If this was a feature I would expect it to be available exactly in the `Breakpoints` setting that you have attached. I will try to contact the support. – Korfu Jun 17 '22 at 06:42
0

As of now the feature is not yet available, but there is a Youtrack ticket for this feature.

Korfu
  • 673
  • 5
  • 20