From 1f4af288afd05f83da17afb819fbd868ace02e9e Mon Sep 17 00:00:00 2001 From: handongxun Date: Thu, 8 Jul 2021 19:59:24 +0800 Subject: [PATCH] fix: report --- packages/vue-cli-plugin-uni/lib/error-reporting.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/vue-cli-plugin-uni/lib/error-reporting.js b/packages/vue-cli-plugin-uni/lib/error-reporting.js index 91752b5a9..fb535f0eb 100644 --- a/packages/vue-cli-plugin-uni/lib/error-reporting.js +++ b/packages/vue-cli-plugin-uni/lib/error-reporting.js @@ -40,6 +40,12 @@ class ErrorReport { if (!this._shouldReport(err)) { return } + + if (typeof err === 'object') { + try { + err = err.toString() + } catch (e) {} + } err = normalizePath(err) || '' err = err.replace(this._UNI_INPUT_DIR_REG, 'UNI_INPUT_DIR') @@ -151,5 +157,5 @@ process global.__error_reporting__ && global.__error_reporting__('unhandledRejection', reason) }) .on('uncaughtException', err => { - global.__error_reporting__ && global.__error_reporting__('uncaughtException', err) + global.__error_reporting__ && global.__error_reporting__('uncaughtException', err.stack) }) -- GitLab