Fixes and Improvements to the search_images_ddg Function in utils.py
Changes include:
Token Parsing: now exits early and returns an empty collection if the search token cannot be parsed, preventing further execution with invalid parameters.
Loop Condition: adjusted the loop to explicitly check max_n as a stopping condition, safer against infinite loops.
Minor Error Handling: generic exception handler to catch and log errors during execution, allowing the function to return any results collected prior to the error.
core functionality of the func remains unchanged, ensuring that it continues to operate as expected.
Fixes and Improvements to the
search_images_ddg
Function inutils.py
Changes include:
max_n
as a stopping condition, safer against infinite loops.core functionality of the func remains unchanged, ensuring that it continues to operate as expected.