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

Using console.error() for Query Failures causes red screen of death on React Native #366

Closed
skevy opened this issue Sep 22, 2015 · 4 comments
Assignees

Comments

@skevy
Copy link
Contributor

skevy commented Sep 22, 2015

a0d80d5

This commit changed to using console.error() to report query failures. In a browser, hidden away in dev tools, this doesn't really matter. On React Native however, in development specifically, using console.error() rather than console.log() causes a red screen of death. This seems like incorrect behavior for relay, as it prevents the developer from handling query errors (such as an unavailable server) gracefully.

@kassens
Copy link
Member

kassens commented Sep 22, 2015

We should probably change this to console.warn. What do you think @yungsters?

@yungsters
Copy link
Contributor

When I originally decided on console.error, my assumption was that in development, you spend majority of your time assuming the request does not fatal. Under this assumption that server errors are unexpected in development, I thought a big red box was better.

That said, I have not had sufficient experience iterating on a product and its error states. I would be fine with changing this to use console.warn if this is a source of pain.

@skevy
Copy link
Contributor Author

skevy commented Sep 23, 2015

The specific use case, if it helps, is the first screen in my app. My graphql endpoint is authenticated, and so when the app first loads (because this first screen is a RelayContainer), the request fails. This is ok - i want to show data on this screen AFTER the user has tapped the 'login w/ Facebook' button.

@yungsters
Copy link
Contributor

Ahh... okay. We should definitely change that to use console.warn.

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