mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
Reversed order of url validation
This commit is contained in:
@@ -100,14 +100,14 @@ class SpiderTool(BaseTool):
|
|||||||
params = {}
|
params = {}
|
||||||
url = website_url or self.website_url
|
url = website_url or self.website_url
|
||||||
|
|
||||||
if not self._validate_url(url):
|
|
||||||
raise ValueError("Invalid URL format")
|
|
||||||
|
|
||||||
if not url:
|
if not url:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Website URL must be provided either during initialization or execution"
|
"Website URL must be provided either during initialization or execution"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not self._validate_url(url):
|
||||||
|
raise ValueError("Invalid URL format")
|
||||||
|
|
||||||
if mode not in ["scrape", "crawl"]:
|
if mode not in ["scrape", "crawl"]:
|
||||||
raise ValueError("Mode must be either 'scrape' or 'crawl'")
|
raise ValueError("Mode must be either 'scrape' or 'crawl'")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user