Browse Source

fix: avoid logging same error twice when thrown by user in global handler

fix #9445
dev
Evan You 6 years ago
parent
commit
ca57920edb
  1. 6
      src/core/util/error.js

6
src/core/util/error.js

@ -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)

Loading…
Cancel
Save