Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): log error detail when import failed (#8930)

donteatfriedricee3a8f1e9bd3b
diff --git a/packages/frontend/core/src/desktop/dialogs/import/index.tsx b/packages/frontend/core/src/desktop/dialogs/import/index.tsx
index 68d6718fc0..189da88e49 100644
--- a/packages/frontend/core/src/desktop/dialogs/import/index.tsx
+++ b/packages/frontend/core/src/desktop/dialogs/import/index.tsx
@@ -5,6 +5,7 @@ import type {
WORKSPACE_DIALOG_SCHEMA,
} from '@affine/core/modules/dialogs';
import { UrlService } from '@affine/core/modules/url';
+import { DebugLogger } from '@affine/debug';
import { useI18n } from '@affine/i18n';
import track from '@affine/track';
import {
@@ -30,6 +31,8 @@ import { type ReactElement, useCallback, useState } from 'react';
import * as style from './styles.css';
+const logger = new DebugLogger('import');
+
type ImportType = 'markdown' | 'markdownZip' | 'notion' | 'snapshot' | 'html';
type AcceptType = 'Markdown' | 'Zip' | 'Html';
type Status = 'idle' | 'importing' | 'success' | 'error';
@@ -421,6 +424,7 @@ export const ImportDialog = ({
status: 'failed',
error: errorMessage || undefined,
});
+ logger.error('Failed to import', error);
}
},
[docCollection, t]