From a04006f75b3388b498a5543bed5aa266064cecb8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 18:56:08 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20address=20code=20review=20=E2=80=94=20na?= =?UTF-8?q?rrow=20exception=20types,=20computed=20dkimLiveText=20getter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/19d17518-732d-4644-889b-cc63256e19b1 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- backend/app/api/api_v1/endpoints/domains.py | 2 +- backend/app/services/dns_resolver.py | 2 +- backend/app/templates/domain_details.html | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) 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 @@