mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-06-21 07:23:56 +08:00
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:
@@ -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') }
|
||||
|
||||
Reference in New Issue
Block a user