Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

PostHog iOS Exception Chain Tracking

PostHog iOS exception chain tracking: version 3.91.1 links chained errors and tags crash sources. Group errors by root cause, not symptom.

· 3 min read

Most app errors are not one failure but a chain. A network call fails, your code wraps it in a data error, and a view model wraps that in a display error. If your analytics only records the last link, every problem looks like the same vague message and your error counts tell you very little.

PostHog iOS SDK 3.91.1 improves the metadata on $exception events. Chained errors are now linked, the chain is capped at 50 entries, and crash and out-of-memory reports get an $exception_source property. Properties you pass to captureException also no longer override $exception_list or $debug_images.

Data Points to Track

  • $exception_list: the ordered list of errors in the chain
  • $exception_source: where the report came from, such as a crash or out-of-memory event
  • chain_length: how many errors are linked
  • root_error_type: the first error in the chain
  • top_error_type: the last error the user saw
  • screen_name: where the error surfaced
  • app_version: the build affected
  • handled: true if your code caught it
  • sdk_version: to separate old and new event shapes

Setup Steps

  1. Upgrade the PostHog iOS SDK to 3.91.1 or later.
  2. Capture errors with the SDK using captureException where you handle failures.
  3. Wrap errors properly with underlying error values, so the chain has something to link.
  4. Check a sample event to confirm $exception_list shows each link.
  5. Group by root_error_type rather than the top message.
  6. Split reports by $exception_source to compare handled errors with crashes and memory kills.
  7. Remove any custom properties that tried to set $exception_list or $debug_images, as they are no longer applied.

Actionable Insights

When many different top-level messages share one root error, you have a single underlying problem. Fixing it clears several alerts at once, which makes it the best use of engineering time.

If chain length keeps growing, your code may be wrapping errors repeatedly. A capped chain at 50 is a sign of a loop or heavy re-wrapping that is worth reviewing.

Compare out-of-memory reports with ordinary crashes. A rise in memory kills on a specific screen usually points to image handling or large data loads, not logic errors.

Common Pitfalls

Do not mix event shapes in one chart without a version filter. Events from older SDK versions lack the new metadata.

Do not assume every handled error is minor. A handled error with a long chain on a payment screen can still hurt revenue.

Why Product Teams Should Care

Error volume is a poor guide on its own. Grouping by root cause tells you how many real problems exist and which users they affect, so you can rank fixes by impact rather than by noise.

Testing Checklist

Throw a nested error in a test build and capture it. Confirm that the chain appears in order, that crash reports carry $exception_source, and that a custom property named $exception_list does not replace the real data.