Skip to content
This repository was archived by the owner on May 12, 2020. It is now read-only.
This repository was archived by the owner on May 12, 2020. It is now read-only.

Suggestion: improve error reporting #30

@benjaminbillet

Description

@benjaminbillet

If an error occurs during async content loading, the error message looks like:
Unexpected error while loading more content:', { line: 81832, column: 47, sourceURL: 'http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }

Such messages are incredibly unhelpful, given that the internal error message is swallowed and the line number is messed up internally by react-native.

The problem is caused by this line:
console.error('Unexpected error while loading more content:', error);

Here, only the content of error will be serialized by console.error, ignoring the prototype chain and thus the value of error.message (defined in Error).

A simple workaround would be to change this line by something like:
console.error('Unexpected error while loading more content:', error.toString(), error);

This is a very small change but it makes the debugging simpler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions