sentry-cocoa: Attach a custom stacktrace when capturing an exception

Platform:

  • iOS
  • tvOS
  • MacOS
  • watchOS

Swift:

  • Yes -> any
  • No

sentry-cocoa installed with:

  • CocoaPods
  • Carthage
  • Manually

Version of sentry-cocoa: 5.2.2


I have the following issue:

I’m writing a sample that uses Sentry for the CrashKiOs library. The library basically lets you create a custom NSException with a custom stacktrace (here for reference) and I want to log this exception with Sentry. But I noticed that this custom stacktrace is never uploaded.

After digging in the source code, I’ve noticed that the capture method does not use the callStackReturnAddresses of the exception passed in the capture method but it adds it builds it for the current thread.

There is already the possibility to append a custom stacktrace and I haven’t found it? If not, there is any possibility to add it in the future? With Firebase Crashalytics or Bugsnag you can but I prefer using Sentry

Steps to reproduce:

To reproduce the issue, I’ve uploaded the WIP sample. In the same repo you can find also the working sample for Crashalytics and Bugsnag

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Thanks for raising this. We could create the Sentry stacktrace based on the callStackReturnAddresses first, and only as a fallback use our current approach.

Yep we could do that @bruno-garcia. I added this to Asana. We can’t give you an ETA though @prof18.

Thanks! I’ll comment on the other ticket if I end up implementing this myself and/or if I need some pointers to work on a stopgap solution.