mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Handle case where infer_webpage_url returns no valid urls
This commit is contained in:
parent
33d36ee58c
commit
1fc280db35
1 changed files with 3 additions and 0 deletions
|
@ -478,6 +478,9 @@ async def infer_webpage_urls(
|
|||
valid_unique_urls = {str(url).strip() for url in urls["links"] if is_valid_url(url)}
|
||||
if is_none_or_empty(valid_unique_urls):
|
||||
raise ValueError(f"Invalid list of urls: {response}")
|
||||
if len(valid_unique_urls) == 0:
|
||||
logger.error(f"No valid URLs found in response: {response}")
|
||||
return []
|
||||
return list(valid_unique_urls)
|
||||
except Exception:
|
||||
raise ValueError(f"Invalid list of urls: {response}")
|
||||
|
|
Loading…
Reference in a new issue