fix(models): pass structured humanizeError to toast on import scan failure

`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>
This commit is contained in:
Cursor Agent
2026-05-19 11:17:08 +00:00
parent 230b5e6dca
commit 7a298d4fe6

View File

@@ -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') }