From 30cea9f737366da74a5980817cddf43e1c5b9cf1 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 3 Oct 2022 11:12:09 +0200 Subject: [PATCH] fix: hide plugin error unless debug is on --- packages/app-backend-core/src/plugin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/app-backend-core/src/plugin.ts b/packages/app-backend-core/src/plugin.ts index b9d509933..e8eec5d6b 100644 --- a/packages/app-backend-core/src/plugin.ts +++ b/packages/app-backend-core/src/plugin.ts @@ -1,6 +1,6 @@ import { PluginQueueItem } from '@vue/devtools-api' import { Plugin, BackendContext, DevtoolsPluginApiInstance } from '@vue-devtools/app-backend-api' -import { BridgeEvents, target } from '@vue-devtools/shared-utils' +import { BridgeEvents, SharedData, target } from '@vue-devtools/shared-utils' import { getAppRecord, getAppRecordId } from './app' export async function addPlugin (pluginQueueItem: PluginQueueItem, ctx: BackendContext) { @@ -22,7 +22,9 @@ export async function addPlugin (pluginQueueItem: PluginQueueItem, ctx: BackendC } } catch (e) { plugin.error = e - console.error(e) + if (SharedData.debugInfo) { + console.error(e) + } } ctx.currentPlugin = null ctx.plugins.push(plugin)