From fa52d544582b5911b5f4024554e04a17c5e0770a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:42:02 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20[code=20health=20improvement]=20?= =?UTF-8?q?Replace=20console.error=20with=20GlobalOutputChannel=20in=20dat?= =?UTF-8?q?abaseModel.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replaced `console.error` with `GlobalOutputChannel?.appendLine` for undo and redo errors in `src/databaseModel.ts`. - Removed redundant `console.error` for auto-save failures where `GlobalOutputChannel` was already being used. - Formats exceptions cleanly using `instanceof Error`. --- src/databaseModel.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/databaseModel.ts b/src/databaseModel.ts index 298b2a0..612a9b7 100644 --- a/src/databaseModel.ts +++ b/src/databaseModel.ts @@ -277,7 +277,7 @@ export class DatabaseDocument extends Disposable implements vsc.CustomDocument { this.#contentChangeEmitter.fire({}); this.#autoSaveIfNeeded(); } catch (e) { - console.error('[Undo] Failed:', e); + GlobalOutputChannel?.appendLine(`[Undo] Failed: ${e instanceof Error ? e.message : String(e)}`); vsc.window.showErrorMessage(vsc.l10n.t('Undo failed: {0}', e instanceof Error ? e.message : String(e))); } }, @@ -292,7 +292,7 @@ export class DatabaseDocument extends Disposable implements vsc.CustomDocument { this.#contentChangeEmitter.fire({}); this.#autoSaveIfNeeded(); } catch (e) { - console.error('[Redo] Failed:', e); + GlobalOutputChannel?.appendLine(`[Redo] Failed: ${e instanceof Error ? e.message : String(e)}`); vsc.window.showErrorMessage(vsc.l10n.t('Redo failed: {0}', e instanceof Error ? e.message : String(e))); } } @@ -470,7 +470,6 @@ export class DatabaseDocument extends Disposable implements vsc.CustomDocument { // Record auto-save failures in the output channel for debugging instead of showing a UI error const errorMessage = err instanceof Error ? err.message : String(err); GlobalOutputChannel?.appendLine(`[Auto-save failed] ${errorMessage}`); - console.error('[Auto-save failed]', err); } }