Skip to content

Commit

Permalink
fix: duplicate call to catchError, closes #1133
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Nov 28, 2021
1 parent 60347d3 commit eaf1da7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/test-e2e/src/components/PartialError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function query (errorPolicy) {
console.log(errorPolicy, result)
},
error (error) {
console.log(error)
console.log('Error', errorPolicy, error)
this.errors[errorPolicy] = error
},
}
Expand Down
2 changes: 1 addition & 1 deletion packages/test-e2e/tests/e2e/specs/errorPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('errorPolicy', () => {

// None
cy.get('.none .result').should('not.contain', 'good').should('not.contain', 'bad')
cy.get('.none .error').should('contain', 'Error: GraphQL error: An error')
cy.get('.none .error').should('contain', 'Error: An error')

// Ignore
cy.get('.ignore .result').should('contain', '"good":"good"').should('contain', '"bad":null}')
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-apollo-option/src/smart-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class SmartQuery extends SmartApollo {
// If `errorPolicy` is set to `all`, an error won't be thrown
// Instead result will have an `errors` array of GraphQL Errors
// so we need to reconstruct an error object similar to the normal one
if (anyErrors) {
if (!error && anyErrors) {
const e = new Error(`GraphQL error: ${errors.map(e => e.message).join(' | ')}`)
Object.assign(e, {
graphQLErrors: errors,
Expand Down

0 comments on commit eaf1da7

Please sign in to comment.