Skip to content

query.fetch raises unhandled error when it finishes to retry #124

@amitripshtos

Description

@amitripshtos

Hey,
When you are using "useQuery" with the parameters:

{ refetchInterval: 1000 }

And the function which fetches the data raises error multiple time (and retrying is being finished), an exception will be thrown without any handling.

How to test it:

  1. Open the Codesandbox of react-query
  2. in line 62 change errorRate to be 1
  3. In line 357 add the refetchInterval property
 } = useQuery(["todos", { filter }], fetchTodos, { refetchInterval: 1000 });
  1. After few seconds the UI will show the unhandled exception

How to fix that:
Basically I think that in query.fetch the in line 366 at "index.js" the "throw error" is causing the issue. I'm not sure why we need to throw that error there so I would like a second eye for that.

Thanks,
Amit.

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