From 2c4d8dbe9b249d200def5b8c512ef8b8dee56624 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Tue, 5 Nov 2024 09:49:43 +0800 Subject: [PATCH] feat(document_extractor): support tool file in document extractor (#10217) --- api/core/workflow/nodes/document_extractor/node.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/core/workflow/nodes/document_extractor/node.py b/api/core/workflow/nodes/document_extractor/node.py index aacee9409..c90017d5e 100644 --- a/api/core/workflow/nodes/document_extractor/node.py +++ b/api/core/workflow/nodes/document_extractor/node.py @@ -198,10 +198,8 @@ def _download_file_content(file: File) -> bytes: response = ssrf_proxy.get(file.remote_url) response.raise_for_status() return response.content - elif file.transfer_method == FileTransferMethod.LOCAL_FILE: - return file_manager.download(file) else: - raise ValueError(f"Unsupported transfer method: {file.transfer_method}") + return file_manager.download(file) except Exception as e: raise FileDownloadError(f"Error downloading file: {str(e)}") from e