Skip to content

Unhandled Promise rejections are ignored and not sent to RUM/Error Tracking - NEED HELP! #803

@ram95krishh

Description

@ram95krishh

Describe the bug

The problem I am trying to solve is a related to this issue

Problem: Unable to view unhandled rejections in my crash / error reporting tool : datadog. They just disappear.

Solution explored: I am looking into patching react native's promise polyfill to surface the unhandled rejection but as a paid customer I am baffled how datadog doesn't inherently support this.

Please suggest an optimal way to capture the unhandled promise rejection error and view it in RUM error tracking. Is this something datadog sdks would support inherently in the future?

Thanks in advance,
Rama.

Reproduction steps

Fire such a function from any functional component in the app.

const unhandledRejectionFn = async() => {
    throw new Error('Unhandled Rejection');
  }

  useEffect(() => { 
    // most of our sdk instantiations happen in a non blocking fashion this way
    // need a way to be able to catch such rejections 
    void unhandledRejectionFn()
  }, [])

These unhandled rejections are not caught by datadog automatically.

SDK logs

No response

Expected behavior

No response

Affected SDK versions

2.4.3

Latest working SDK version

NA

Did you confirm if the latest SDK version fixes the bug?

Yes

Integration Methods

Yarn

React Native Version

0.75.5

Package.json Contents

{
"react-native": "0.75.5",
"@datadog/mobile-react-native": "2.4.3",

iOS Setup

No response

Android Setup

No response

Device Information

No response

Other relevant information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions