mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-29 23:12:38 +08:00
fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置
将错误抛出语句移至else分支
This commit is contained in:
parent
5241f11eeb
commit
7fa2e62dce
@ -73,8 +73,9 @@ const imageOcr = async (file: ImageFileMetadata, provider: ImageOcrProvider): Pr
|
||||
export const ocr = async (file: SupportedOcrFile, provider: OcrProvider): Promise<OcrResult> => {
|
||||
if (isImageFile(file) && isImageOcrProvider(provider)) {
|
||||
return imageOcr(file, provider)
|
||||
} else {
|
||||
throw new Error(`File type and provider capability is not matched, otherwise one of them is not supported.`)
|
||||
}
|
||||
throw new Error(`File type and provider capability is not matched, otherwise one of them is not supported.`)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user