From ca57920edb56000bfc87bb64f4e5e3450c03e13a Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 7 Feb 2019 10:17:28 -0500 Subject: [PATCH] fix: avoid logging same error twice when thrown by user in global handler fix #9445 --- src/core/util/error.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/util/error.js b/src/core/util/error.js index 6110639e..e4604ecf 100644 --- a/src/core/util/error.js +++ b/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)