mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-30 11:42:21 +03:00
fix(core): log error detail when import failed (#8930)
This commit is contained in:
parent
6ac8cca440
commit
e3a8f1e9bd
@ -5,6 +5,7 @@ import type {
|
|||||||
WORKSPACE_DIALOG_SCHEMA,
|
WORKSPACE_DIALOG_SCHEMA,
|
||||||
} from '@affine/core/modules/dialogs';
|
} from '@affine/core/modules/dialogs';
|
||||||
import { UrlService } from '@affine/core/modules/url';
|
import { UrlService } from '@affine/core/modules/url';
|
||||||
|
import { DebugLogger } from '@affine/debug';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import track from '@affine/track';
|
import track from '@affine/track';
|
||||||
import {
|
import {
|
||||||
@ -30,6 +31,8 @@ import { type ReactElement, useCallback, useState } from 'react';
|
|||||||
|
|
||||||
import * as style from './styles.css';
|
import * as style from './styles.css';
|
||||||
|
|
||||||
|
const logger = new DebugLogger('import');
|
||||||
|
|
||||||
type ImportType = 'markdown' | 'markdownZip' | 'notion' | 'snapshot' | 'html';
|
type ImportType = 'markdown' | 'markdownZip' | 'notion' | 'snapshot' | 'html';
|
||||||
type AcceptType = 'Markdown' | 'Zip' | 'Html';
|
type AcceptType = 'Markdown' | 'Zip' | 'Html';
|
||||||
type Status = 'idle' | 'importing' | 'success' | 'error';
|
type Status = 'idle' | 'importing' | 'success' | 'error';
|
||||||
@ -421,6 +424,7 @@ export const ImportDialog = ({
|
|||||||
status: 'failed',
|
status: 'failed',
|
||||||
error: errorMessage || undefined,
|
error: errorMessage || undefined,
|
||||||
});
|
});
|
||||||
|
logger.error('Failed to import', error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[docCollection, t]
|
[docCollection, t]
|
||||||
|
Loading…
Reference in New Issue
Block a user