Skip to content

setNativeExceptionHandler callback is not being invoked on Android #62

@mark-friedman

Description

@mark-friedman

All I was trying to do was a console.log() in that callback.

    setNativeExceptionHandler((exceptionString) => {
      console.log(exceptionString);
    });

The exception that is being triggered is fairly deep in some native View rendering code (originally thrown, I believe, here, and then caught and rethrown here).

At first I set a breakpoint at that console.log() using the React Native debugger within Chrome and saw that the breakpoint was never getting reached.

Thinking that maybe there was some bad interaction between native code and the React Native debugger, I ran our app under the Android Studio debugger and set a breakpoint immediately before and after the invocation of the callback supplied to setNativeExceptionHandler (here). Doing so, I noticed the following message displayed in logcat during that invocation:

W/unknown:ReactNative: Invoking JS callback after bridge has been destroyed.

This could explain why we weren't seeing the result of the execution of that callback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions