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

Error in Queries result in cryptic React error #355

Open
sporto opened this issue Jun 29, 2015 · 3 comments
Open

Error in Queries result in cryptic React error #355

sporto opened this issue Jun 29, 2015 · 3 comments

Comments

@sporto
Copy link
Contributor

sporto commented Jun 29, 2015

In Marty 0.10.4

If I have an error in a query:

class Queries extends Marty.Queries {

    fetchFinancials(personId) {
        [].foo();

        ...
    }

}

I see this in the console:

"Unhandled rejection invariant ...

So from the stack trace there is no clue what the error is.

This is a query called by a Container -> Store -> Query

@taion
Copy link
Member

taion commented Jun 29, 2015

Do you have an associated stack trace?

@sporto
Copy link
Contributor Author

sporto commented Jun 29, 2015

@taion here is an example stack trace https://gist.github.com/sporto/d20cee5307b33e92df26

@pbomb
Copy link
Contributor

pbomb commented Jul 2, 2015

We've had to put a try catch around the dispatch call in ActionCreators or Queries objects to get at the actual error. Otherwise, they get suppressed in Marty.

On a related note, is there a way to know the status of each fetch property in a Marty container? For instance, in my failed handler, I'd like to log out which fetches failed, but I don't see a bulletproof way to determine which fetches are in which state. Should I test if the fetch property value is an instance of Error? Is that the preferred/safe way?

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