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 vuejs#9445
  • Loading branch information
yyx990803 authored and Lostlover committed Dec 10, 2019
1 parent a05a682 commit a9fc7e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/util/error.js
Original file line number Diff line number Diff line change
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 a9fc7e2

Please sign in to comment.