Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested inner exceptions are not filtered correctly #1916

Closed
mattjohnsonpint opened this issue Sep 13, 2022 · 0 comments · Fixed by #1924
Closed

Nested inner exceptions are not filtered correctly #1916

mattjohnsonpint opened this issue Sep 13, 2022 · 0 comments · Fixed by #1924
Labels
Bug Something isn't working

Comments

@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Sep 13, 2022

SDK Version

3.21.0

Steps to Reproduce

using Sentry;

using (SentrySdk.Init(o =>
       {
           o.Dsn = "https://eb18e953812b41c3aeb042e666fd3b5c@o447951.ingest.sentry.io/5428537";
           o.Debug = true;
           o.AddExceptionFilterForType<MyException>();
       }))
{
    throw new AggregateException(new MyException());
}

public class MyException : Exception
{
}

Expected Result

No exception should be sent, because it's been configured to be filtered out.

Actual Result

The exception is sent anyway, because it's an inner exception of another exception.

We already unwind inner exceptions and discard aggregates, but we appear to be filtering beforehand. We probably should still filter before, because we'd want to discard any child exceptions of a filtered exception also. We just need to walk the entire tree during the filtering process.

I haven't checked, but this probably applies to exception processors as well.

@mattjohnsonpint mattjohnsonpint added Bug Something isn't working Platform: .NET labels Sep 13, 2022
@mattjohnsonpint mattjohnsonpint changed the title Nested inner exceptions are not filtered correectly Nested inner exceptions are not filtered correctly Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant