jlcodes99/cockpit-tools · error
common.shared.externalImport.bundleEmpty
common.shared.externalImport.bundleEmpty
Error message
common.shared.externalImport.bundleEmpty (导入包内容为空)
What it means
Sentinel guard in the external import flow: after optionally fetching the bundle from importUrl via 'external_import_fetch_import_url' (or using the pasted token), the resulting content trims to an empty string. It fires when the fetch backend returns empty output or the user submits only whitespace, so there is no bundle to parse.
Source
Thrown at src/hooks/useProviderAccountsPage.ts:1632
void (async () => {
try {
let content = request.token.trim();
if (importUrl) {
updateProgress({
status: 'fetching',
progress: 20,
message: t(
'common.shared.externalImport.statusFetching',
'正在获取导入包...',
),
});
content = await invoke<string>('external_import_fetch_import_url', {
importUrl,
});
}
if (!content.trim()) {
throw new Error(t('common.shared.externalImport.bundleEmpty', '导入包内容为空'));
}
updateProgress({
status: 'parsing',
progress: 35,
message: t(
'common.shared.externalImport.statusParsing',
'正在解析 Codex JSON...',
),
});
const resolvedItems = resolveExternalImportBundleItems(content, platformId, {
invalidJson: t(
'common.shared.externalImport.bundleInvalidJson',
'导入包不是有效 JSON',
),
empty: t('common.shared.externalImport.bundleEmpty', '导入包内容为空'),
providerMismatch: t(
'common.shared.externalImport.bundleProviderMismatch',View on GitHub (pinned to 1ed8b77992)
Solutions
- Check that the import URL points to a reachable, non-empty bundle file
- Verify the backend 'external_import_fetch_import_url' command returns the full body and does not swallow content on redirects
- Re-paste the import token; leading/trailing whitespace-only input is rejected
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/hooks/useProviderAccountsPage.ts:1632 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of jlcodes99/cockpit-tools@1ed8b77992 (2026-09-05).
Data as JSON: /api/errors/b6f9c1e7b69b2ce5.
Report an issue: GitHub.