Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix: on error the message is always the same
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGabriele committed Aug 27, 2018
1 parent 2b63f6d commit bad42a0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ export default () => {
]

if (shouldGaLoad() && (!window.ga || !noScript)) {
queue.push(loadScript(resource))
queue.push(
loadScript(resource).catch(() => {
throw new Error (
`[vue-analytics] An error occured! Please check your connection, ` +
`if you have any Google Analytics blocker installed in your browser ` +
`or check your custom resource URL if you have added any.`
)
})
)
}

return Promise.all(queue).then(response => {
Expand All @@ -51,11 +59,7 @@ export default () => {

// Starts auto tracking
autoTracking()
}).catch(response => {
console.error(
`[vue-analytics] An error occured! Please check your connection, ` +
`if you have any Google Analytics blocker installed in your browser ` +
`or check your custom resource URL if you have added any.`
)
}).catch(error => {
console.error(error.message)
})
}

0 comments on commit bad42a0

Please sign in to comment.