From 813b78338dcd91e53eb1ef189b84f2535e287236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adem=C3=ADlson=20Tonato?= Date: Wed, 11 Jun 2025 18:44:16 +0100 Subject: [PATCH] fix: update error handling in FirecrawlApp to comply with mypy type checking --- api/core/rag/extractor/firecrawl/firecrawl_app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/core/rag/extractor/firecrawl/firecrawl_app.py b/api/core/rag/extractor/firecrawl/firecrawl_app.py index b77c73c51c..83a4ac651f 100644 --- a/api/core/rag/extractor/firecrawl/firecrawl_app.py +++ b/api/core/rag/extractor/firecrawl/firecrawl_app.py @@ -22,7 +22,7 @@ class FirecrawlApp: "formats": ["markdown"], "onlyMainContent": True, "timeout": 30000, - "integration": "dify" + "integration": "dify", } if params: json_data.update(params) @@ -125,8 +125,7 @@ class FirecrawlApp: def _handle_error(self, response, action) -> None: error_message = response.json().get("error", "Unknown error occurred") - raise Exception(f"Failed to {action}. Status code: {response.status_code}. Error: {error_message}") - return # Explicit return for mypy compliance + raise Exception(f"Failed to {action}. Status code: {response.status_code}. Error: {error_message}") # type: ignore[return] def search(self, query: str, params: dict[str, Any] | None = None) -> dict[str, Any]: # Documentation: https://docs.firecrawl.dev/api-reference/endpoint/search @@ -139,7 +138,7 @@ class FirecrawlApp: "timeout": 60000, "ignoreInvalidURLs": False, "scrapeOptions": {}, - "integration": "dify" + "integration": "dify", } if params: json_data.update(params)