Skip to content

Commit eaf1da7

Browse files
committed
fix: duplicate call to catchError, closes #1133
1 parent 60347d3 commit eaf1da7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/test-e2e/src/components/PartialError.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function query (errorPolicy) {
1515
console.log(errorPolicy, result)
1616
},
1717
error (error) {
18-
console.log(error)
18+
console.log('Error', errorPolicy, error)
1919
this.errors[errorPolicy] = error
2020
},
2121
}

packages/test-e2e/tests/e2e/specs/errorPolicy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('errorPolicy', () => {
88

99
// None
1010
cy.get('.none .result').should('not.contain', 'good').should('not.contain', 'bad')
11-
cy.get('.none .error').should('contain', 'Error: GraphQL error: An error')
11+
cy.get('.none .error').should('contain', 'Error: An error')
1212

1313
// Ignore
1414
cy.get('.ignore .result').should('contain', '"good":"good"').should('contain', '"bad":null}')

packages/vue-apollo-option/src/smart-query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export default class SmartQuery extends SmartApollo {
175175
// If `errorPolicy` is set to `all`, an error won't be thrown
176176
// Instead result will have an `errors` array of GraphQL Errors
177177
// so we need to reconstruct an error object similar to the normal one
178-
if (anyErrors) {
178+
if (!error && anyErrors) {
179179
const e = new Error(`GraphQL error: ${errors.map(e => e.message).join(' | ')}`)
180180
Object.assign(e, {
181181
graphQLErrors: errors,

0 commit comments

Comments
 (0)