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

Errors in reducer function get swallowed #1094

Closed
helfer opened this issue Dec 25, 2016 · 6 comments
Closed

Errors in reducer function get swallowed #1094

helfer opened this issue Dec 25, 2016 · 6 comments
Labels

Comments

@helfer
Copy link
Contributor

helfer commented Dec 25, 2016

Tried to write a test for query variables yesterday, and errors thrown in the reducer function didn't show up anywhere. This may only be happening in the tests, but we should fix it anyway.

@eminaz
Copy link

eminaz commented Dec 26, 2016

+1 on this and this happens in the app as well. Currently I have to write the same code in updateQueries first to find what the errors are, after making sure there are no more errors, then move the code to the reducer function.

@gpsamson
Copy link

gpsamson commented Jan 1, 2017

+1 for this too. I've been running around in circles for about an hour and it turns out a reducer error was thrown and stored in the store, but it was never logged to the console.

The reducer error was thrown because I wasn't explicitly setting optional arguments to null. I'll be opening an issue for this specifically if it doesn't exist.

@calebmer
Copy link
Contributor

calebmer commented Jan 6, 2017

@eminaz and @gpsamson could you try reproducing with 0.6.0, it may have been fixed because a test reproducing the error passes. See #1143. Are you using react-apollo? Currently react-apollo doesn’t log unhandled errors.

@gpsamson
Copy link

@calebmer I can confirm that an error is logged if you don't define all of the variables.

@colvint
Copy link

colvint commented Apr 1, 2017

+1 for reducer errors getting swallowed. In my case, I was returning an object from my reducer which was missing a field which was present in the underlying query / fragment it was intended to update.

@helfer
Copy link
Contributor Author

helfer commented May 3, 2017

This might be fixed now. If it's still an issue, please open a new issue!

@helfer helfer closed this as completed May 3, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants