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. 4
      src/core/util/error.js

4
src/core/util/error.js

@ -49,9 +49,13 @@ function globalHandleError (err, vm, info) {
try { try {
return config.errorHandler.call(null, err, vm, info) return config.errorHandler.call(null, err, vm, info)
} catch (e) { } catch (e) {
// 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(e, null, 'config.errorHandler')
} }
} }
}
logError(err, vm, info) logError(err, vm, info)
} }

Loading…
Cancel
Save