fix: improve error handling for temporary file removal in FileDownloadTool

This commit is contained in:
Soulter
2026-02-01 18:12:40 +08:00
parent 2213fb1ebf
commit 313a6d8a24
+5 -5
View File
@@ -182,11 +182,11 @@ class FileDownloadTool(FunctionTool):
except Exception as e:
logger.error(f"Error sending file message: {e}")
# remove
try:
os.remove(local_path)
except Exception as e:
logger.error(f"Error removing temp file {local_path}: {e}")
# remove
try:
os.remove(local_path)
except Exception as e:
logger.error(f"Error removing temp file {local_path}: {e}")
return f"File downloaded successfully to {local_path}"
except Exception as e: