#C# Stack Trace formatting

5 messages · Page 1 of 1 (latest)

main oasis
#

Hello,
We are migrating from Appcenter to Sentry and are having an issue with the formatting of the stack trace that Sentry appears to be receiving.

Raw Stack Traces;
Appcenter/Event Viewer

Exception Stack:
System.Exception: Exception of type 'System.Exception' was thrown.
  at (AppName).(WindowName).ButtonClick(Object sender, RoutedEventArgs e) in (System Address)
  at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

Sentry

System.Exception: Exception of type 'System.Exception' was thrown.
  ?, in void (WindowName).ButtonClick(object  , RoutedEventArgs  )
  ?, in void EventRoute.InvokeHandlersImpl(object source, RoutedEventArgs args, bool reRaised)

As you can see Sentry seems to be leaving out (AppName), "System.Windows" etc and adding "?, in void".

Is there anyway to make Sentry format it similar to Appcenter?

Unfortunately our obfuscators don't recognise the format so can't de-obfuscate the stack traces.

Thank you for any help :).

wispy condor
#

as a work around, I suggest writing a BeforeSend callback that takes the exception and sets it in the Extra

#

like: ```
SetBeforeSend((e,h) => {
if (e.Exception?.ToString() is {} exString) {
e.SetExtra("rawEx", exString);
}

#

it won't change how Sentry presents the stack trace, but at the bottom of the page u'll see it in the ".NET format"