From 7a298d4fe6f8c623c424542372c3d23c4d986adf Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 19 May 2026 11:17:08 +0000 Subject: [PATCH] fix(models): pass structured humanizeError to toast on import scan failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `humanizeError()` returns an object; interpolating it into a template string produced "[object Object]", hiding the real scan failure (same pitfall fixed for lazy-deps). Pass the object directly so toast renders message, hint, and raw. Co-authored-by: 晴天 <1186258278@users.noreply.github.com> --- src/pages/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/models.js b/src/pages/models.js index f96b17f..724fa9c 100644 --- a/src/pages/models.js +++ b/src/pages/models.js @@ -1308,7 +1308,7 @@ async function importClientConfigs(page, state) { const result = await api.scanModelClientConfigs() candidates = Array.isArray(result?.candidates) ? result.candidates : [] } catch (e) { - toast(`${t('models.importScanFailed')}: ${humanizeError(e)}`, 'error') + toast(humanizeError(e, t('models.importScanFailed')), 'error') return } finally { if (btn) { btn.disabled = false; btn.textContent = oldText || t('models.importClientConfigs') }