Skip to content

Conversation

@velocitysystems
Copy link
Contributor

[Bug fix:] Fix unhandled exception tag and fatal tag overwrite in CrashReporter

Description πŸ“

  • Purpose: Fixes #216 β€” CrashReporter.processUnhandledError tags unhandled errors with UnhandledError instead of UnhandledException, which prevents the Raygun web app's "Unhandled exception" filter from matching React Native crash reports. Additionally, when isFatal is true, the Fatal tag overwrites the unhandled tag instead of being additive, so fatal crashes lose the unhandled tag entirely.
  • Approach: Renamed the tag from UnhandledError to UnhandledException to align with all other Raygun providers. Changed the fatal tag logic to push Fatal onto the existing tags array rather than replacing it, so fatal crashes are tagged with both UnhandledException and Fatal.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Updates

πŸ‘‰ Changed UnhandledError tag to UnhandledException in sdk/src/CrashReporter.ts
πŸ‘‰ Made Fatal tag additive instead of overwriting the unhandled tag
πŸ‘‰ Added two regression tests covering both non-fatal and fatal unhandled error tagging

Screenshots πŸ“·

N/A β€” backend tagging change, no UI impact.

Test plan πŸ§ͺ

  1. Run the unit tests: cd sdk && npx jest --no-coverage
  2. Verify the two new tests pass:
    • should tag unhandled errors with UnhandledException β€” confirms the UnhandledException tag is present and UnhandledError is not.
    • should tag fatal unhandled errors with both UnhandledException and Fatal β€” confirms both tags are present additively.
  3. Manual verification:
    • Initialise RaygunClient with enableCrashReporting: true
    • Throw an unhandled exception (e.g. setTimeout(() => { throw new Error('test'); }, 0))
    • Confirm the crash report in the Raygun dashboard is tagged UnhandledException
    • Throw a fatal unhandled exception and confirm the report has both UnhandledException and Fatal tags
    • Confirm the Raygun web app's "Unhandled" filter now matches React Native crash reports

Author to check πŸ‘“

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Reviewer to check βœ”οΈ

  • Project and all contained modules builds successfully
  • Change has been dev-/reviewer-tested, where possible
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Copy link
Contributor

@TheRealAgentK TheRealAgentK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I like the streamlining to match the other providers.

@velocitysystems velocitysystems merged commit 1448f34 into master Feb 10, 2026
8 checks passed
@velocitysystems velocitysystems deleted the unhandled branch February 10, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled exception tag is UnhandledError instead of UnhandledException

2 participants