Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get full error? #150

Open
stharvey opened this issue May 3, 2021 · 3 comments
Open

How to get full error? #150

stharvey opened this issue May 3, 2021 · 3 comments

Comments

@stharvey
Copy link

stharvey commented May 3, 2021

Hello,

This looks like a great tool, thanks for creating it.

I'm trying to show the error line as well as the stack details. I'm probably missing something.

For example the error in the terminal shows:

[Mon May 03 2021 16:10:00.498]  ERROR    ReferenceError: Can't find variable: profilePic

This error is located at:
    in ProfileScreen (at SceneView.tsx:122)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:115)
    in EnsureSingleNavigator (at SceneView.tsx:114)
    ...etc.

however the error being received by react-native-exception-handler just shows:

in ProfileScreen (at SceneView.tsx:122)
in StaticContainer
in StaticContainer (at SceneView.tsx:115)
in EnsureSingleNavigator (at SceneView.tsx:114)
...etc.

If anyone can give some pointers about what I am doing wrong and how I can get the "ReferenceError: Can't find variable: profilePic" part too please can you let me know.

This is how I am using it:

  setJSExceptionHandler((error, isFatal) => {
    logError(error, isFatal);
  }, true);

  setNativeExceptionHandler((error, isFatal) => {;
    logError(error, isFatal);
  }, true);

And the method logError is saving the error to the database.

Thanks a lot.

@stharvey stharvey changed the title How to show full error? How to get full error? May 3, 2021
@stharvey
Copy link
Author

stharvey commented May 3, 2021

Also, other errors are coming through like this:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.%s

I'm assuming that I must have something configured wrongly to be seeing "%s.%s" instead of the full error.

Any pointers would be appreciated.

@Hook-Da
Copy link

Hook-Da commented May 28, 2021

Actually it leaves the message behind in index.js file and only string of calls visible
if (allowed) {
global.ErrorUtils.setGlobalHandler(customHandler);
console.error = (message, error) => global.ErrorUtils.reportError(error); // sending console.error so that it can be caught
} else {
console.log("Skipping setJSExceptionHandler: Reason: In DEV mode and allowedInDevMode = false");
}
Here message leaves behind.

@Ejdamm
Copy link

Ejdamm commented Sep 9, 2021

I have the same problem (the %s.%s)

@Hook-Da 's answer seems to point at the right spot but that code changed in 2.10.10. My problem persists.

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

No branches or pull requests

3 participants