diff --git a/backend/app/api/api_v1/endpoints/domains.py b/backend/app/api/api_v1/endpoints/domains.py index cf3cdd2..bc37ed3 100644 --- a/backend/app/api/api_v1/endpoints/domains.py +++ b/backend/app/api/api_v1/endpoints/domains.py @@ -168,7 +168,7 @@ async def get_domains_summary(db: Session = Depends(get_db)): provider.check_domain(domain_name, selectors=combined), timeout=10.0, ) - except (asyncio.TimeoutError, Exception) as exc: # pylint: disable=broad-exception-caught + except (asyncio.TimeoutError, LookupError, OSError) as exc: logger.warning("DNS check failed for %s: %s", domain_name, exc) return DomainDNSResult() diff --git a/backend/app/services/dns_resolver.py b/backend/app/services/dns_resolver.py index 502deb7..571a08d 100644 --- a/backend/app/services/dns_resolver.py +++ b/backend/app/services/dns_resolver.py @@ -234,7 +234,7 @@ class CloudflareDNSProvider(BaseDNSProvider): txt = answer.get("data", "").strip('"') records.append(txt) return records - except Exception as exc: + except (httpx.RequestError, httpx.HTTPStatusError, httpx.TimeoutException) as exc: raise LookupError(f"Cloudflare DoH lookup failed for {name}: {exc}") from exc diff --git a/backend/app/templates/domain_details.html b/backend/app/templates/domain_details.html index c3d5fed..91132e7 100644 --- a/backend/app/templates/domain_details.html +++ b/backend/app/templates/domain_details.html @@ -160,7 +160,7 @@