This commit is contained in:
Pathbit Logins 2026-08-28 01:27:05 -03:00 committed by GitHub
commit 4fd8bb2034
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -204,6 +204,19 @@ class SearXNGSearchConfig(BaseSearchConfig):
Returns:
SearchResponse with standardized format
"""
if not 200 <= raw_response.status_code < 300:
# The HTTP handlers for this provider do not call raise_for_status,
# so an upstream 429/503 would otherwise be parsed as a successful
# response with zero results. The upstream body is deliberately not
# echoed, because it can contain the original query.
raise self.get_error_class(
error_message=(
f"SearXNG search provider returned HTTP {raw_response.status_code}"
),
status_code=raw_response.status_code,
headers=dict(raw_response.headers),
)
response_json: Final = raw_response.json()
# Transform results to SearchResult objects