Skip to content

Commit

Permalink
fix(core): log error detail when import failed (#8930)
Browse files Browse the repository at this point in the history
  • Loading branch information
donteatfriedrice committed Nov 26, 2024
1 parent 6ac8cca commit e3a8f1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/frontend/core/src/desktop/dialogs/import/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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';
Expand Down Expand Up @@ -421,6 +424,7 @@ export const ImportDialog = ({
status: 'failed',
error: errorMessage || undefined,
});
logger.error('Failed to import', error);
}
},
[docCollection, t]
Expand Down

0 comments on commit e3a8f1e

Please sign in to comment.