From cb2b6a02921941d5ff3a0d1eeea1b0f53b3c193a Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Tue, 27 Oct 2026 01:41:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20show=20clear=20error=20message=20when=20?= =?UTF-8?q?MarkBase=20needs=20restart=20(PostgreSQL=E2=86=92SQLite=20migra?= =?UTF-8?q?tion)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Detects 'missing field postgresql' error from MarkBase config endpoint - Shows user-friendly message: 'MarkBase needs restart (PostgreSQL→SQLite migration)' - Helps users understand the error is due to outdated MarkBase instance --- src/views/AdminView.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/AdminView.vue b/src/views/AdminView.vue index 3ddc8c0..f58cbf1 100644 --- a/src/views/AdminView.vue +++ b/src/views/AdminView.vue @@ -1038,9 +1038,13 @@ async function loadSettings() { try { const resp = await fetch(`${markbaseUrl.value}/api/v2/config`) if (!resp.ok) { - // MarkBase config may return 500 if config file is incomplete const errData = await resp.json().catch(() => null) - throw new Error(`HTTP ${resp.status}: ${errData?.error || resp.statusText}`) + const errMsg = errData?.error || resp.statusText || '' + // MarkBase config may return 500 if still running old version requiring postgresql + if (errMsg.includes('postgresql')) { + throw new Error('MarkBase needs restart (PostgreSQL→SQLite migration)') + } + throw new Error(`HTTP ${resp.status}: ${errMsg}`) } const cfg = await resp.json() uploadPath.value = cfg.server?.upload_path || ''