Skip to content

Commit

Permalink
fix: avoid logging same error twice when thrown by user in global han…
Browse files Browse the repository at this point in the history
…dler

fix #9445
  • Loading branch information
yyx990803 committed Feb 7, 2019
1 parent 57bc80a commit ca57920
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/util/error.js
Expand Up @@ -49,7 +49,11 @@ function globalHandleError (err, vm, info) {
try {
return config.errorHandler.call(null, err, vm, info)
} catch (e) {
logError(e, null, 'config.errorHandler')
// if the user intentionally throws the original error in the handler,
// do not log it twice
if (e !== err) {
logError(e, null, 'config.errorHandler')
}
}
}
logError(err, vm, info)
Expand Down

0 comments on commit ca57920

Please sign in to comment.