Skip to content

Commit a407b6c

Browse files
authored
fix(ddg): restore broad exception catch in search() to prevent pipeline crashes (#74)
PR #66 narrowed except Exception to (KeyError, ValueError, TypeError, AttributeError) — but httpx network errors (ReadTimeout, ConnectError, RemoteProtocolError) are not subclasses of those. Network errors during DDG searches propagated up and crashed the entire search-news CI step. This is a system boundary: any search failure should return [], not crash.
1 parent 42be520 commit a407b6c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

disaster_report/sources/ddg_news.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def search(self, query: str, timelimit: str | None = None) -> list[NewsItem]:
101101
return []
102102
except DDGSException:
103103
return []
104-
except (KeyError, ValueError, TypeError, AttributeError) as exc:
104+
except Exception as exc:
105105
logger.warning(
106106
"ddg unexpected error (query=%s): %r", query[:60], exc
107107
)

0 commit comments

Comments
 (0)