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

Catch fetchQuery errors in startQuery. #950

Merged
merged 3 commits into from
Nov 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Louis DeScioli <[email protected]>
Marc-Andre Giroux <[email protected]>
Martijn Walraven <[email protected]>
Maxime Quandalle <[email protected]>
Michiel ter Reehorst <[email protected]>
Oleksandr Stubailo <[email protected]>
Olivier Ricordeau <[email protected]>
Pavol Fulop <[email protected]>
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Expect active development and potentially significant breaking changes in the `0

### vNEXT

- Catch uncaught promise errors in QueryManager [#950](https://github.com/apollostack/apollo-client/pull/950)

### 0.5.6
- Refactor polling query logic to fix startPolling and stopPolling [#938](https://github.com/apollostack/apollo-client/pull/938)
- Add convenience method to obtain initial state from SSR [#941](https://github.com/apollostack/apollo-client/pull/941)
Expand Down
5 changes: 4 additions & 1 deletion src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,10 @@ export class QueryManager {
public startQuery(queryId: string, options: WatchQueryOptions, listener: QueryListener) {
this.addQueryListener(queryId, listener);

this.fetchQuery(queryId, options);
this.fetchQuery(queryId, options)
// `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the
// console will show an `Uncaught (in promise)` message. Ignore the error for now.
.catch((error: Error) => undefined);

return queryId;
}
Expand Down