mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
fix(translate): show detailed error message when file processing fails
This commit is contained in:
parent
7942147ce0
commit
96f71f12ec
@ -29,7 +29,7 @@ import {
|
||||
type TranslateHistory,
|
||||
type TranslateLanguage
|
||||
} from '@renderer/types'
|
||||
import { getFileExtension, isTextFile, runAsyncFunction, uuid } from '@renderer/utils'
|
||||
import { getErrorMessage, getFileExtension, isTextFile, runAsyncFunction, uuid } from '@renderer/utils'
|
||||
import { abortCompletion } from '@renderer/utils/abortController'
|
||||
import { isAbortError } from '@renderer/utils/error'
|
||||
import { formatErrorMessage } from '@renderer/utils/error'
|
||||
@ -671,7 +671,7 @@ const TranslatePage: FC = () => {
|
||||
await processFile(selectedFile)
|
||||
} catch (error) {
|
||||
logger.error('onPaste:', error as Error)
|
||||
window.toast.error(t('chat.input.file_error'))
|
||||
window.toast.error({ title: t('chat.input.file_error'), description: getErrorMessage(error) })
|
||||
}
|
||||
}
|
||||
setIsProcessing(false)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user