How to cancel event on the bugsnag in C#?

74 views Asked by At

How to cancel event on the bugsnag in C# I try something like the below but its not work

    func(event *bugsnag.Event, config *bugsnag.Configuration) error {
        for _, datum := range event.RawData {
            if user, ok := datum.(*MyUserInfo); ok {
                event.User = &User{Id: user.Id}
            }
        }
    }) ```
1

There are 1 answers

0
AMustafa On

You can do it like the below code:

Bugsnag.AspNet.Client.Current.BeforeNotify(report =>
            {
                if (report.Event.Request.Url.Contains("healthcheck.aspx"))
                {
                    report.Ignore();
                }
            });