Howto filter exceptions before send to sentry


#1

Hi:

Mobile application, basically is running on c#. We are using sentry (ravenClient and SharpRaven) to send exceptions to sentry. My question is: i need filter exceptions “Before” send to sentry, as i can see i can use ravenClient.BeforeSend method but i can not find a good example of use, i just got this:

ravenClient.BeforeSend = requester =>
{
// Here you can log data from the requester
// or replace it entirely if you want.
return requester;
};

It’s ok but what happen if i want filter exceptions in c# before send and i would like to have just most critical exceptions like json errors or timeouts exceptions with or without constructor to use (Exception)Activator.CreateInstance method from c# (it suppose that create instance can make an instance of a new exception after pass parameters like name and message)


#2

I’m sorry @istasp but I couldn’t really understand what you are after.

Do you want to avoid capturing an event that was created from an Exception of a specific type?
I’m not sure why the reference to creating exception via reflection (Activator.CreateInstance).

Do you want to only report Timeouts and JSON serialization issues?

Please note that RavenSharp is our Legacy SDK, we’ve release a new .NET SDK:

The new SDK also has BeforeSend where you can modify/reject the event but instead of the Requester abstraction of RavenSharp, you have the actual SentryEvent that is serialized and sent to Sentry.

One more thing to clarify, when you say C# mobile app, are you using Xamarin? If not, what framework?


#3

Thanks for your answer.

One questions please:

  1. If you have an app with Xamarin for ipad, and is using now SharpRaven as SDK, if you want use Sentry instead of SharpRaven…is this new sdk backward compatible ? I mean are there major changes in source code replacing old SDK by new ?