Skip to content

Commit

Permalink
Merge pull request #950 from jamiter/patch-1
Browse files Browse the repository at this point in the history
Catch `fetchQuery` errors in `startQuery`.
  • Loading branch information
helfer authored Nov 28, 2016
2 parents 6286245 + 91b9619 commit de8c57f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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

0 comments on commit de8c57f

Please sign in to comment.