Skip to content

Commit 5566208

Browse files
author
Guillaume Chau
committed
feat(ui): basic global error handler
1 parent d62ad77 commit 5566208

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/@vue/cli-ui/src/vue-apollo.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ export const apolloProvider = new VueApollo({
4747
mod
4848
}
4949
})
50+
},
51+
errorHandler (error) {
52+
console.log('%cAn error occured', 'background: red; color: white; padding: 4px; border-radius: 4px;font-weight: bold;')
53+
console.log(error.message)
54+
if (error.graphQLErrors) {
55+
console.log(error.graphQLErrors)
56+
}
57+
if (error.networkError) {
58+
console.log(error.networkError)
59+
}
5060
}
5161
})
5262

0 commit comments

Comments
 (0)