Korfu
Korfu

Reputation: 831

Break when exception is thrown except for when thrown in specific place in Rider

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?

Upvotes: 0

Views: 225

Answers (2)

Korfu
Korfu

Reputation: 831

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

Upvotes: 0

mu88
mu88

Reputation: 5434

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.

Upvotes: 1

Related Questions