Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Retry domain search when the timeout aborts the body read

Rafi14e170dd7287
diff --git a/apps/web/lib/dynadot/search-domains.ts b/apps/web/lib/dynadot/search-domains.ts
index 09b6b24d4f..49e37ede10 100644
--- a/apps/web/lib/dynadot/search-domains.ts
+++ b/apps/web/lib/dynadot/search-domains.ts
@@ -69,8 +69,11 @@ async function searchWithRetry(
} catch (error) {
// A null status means Dynadot sent no response (network error or timeout).
// Request validation errors also have a null status, but the route validates the domain first.
+ // The timeout can also abort the body read after the headers arrived, which throws a plain TimeoutError.
const noResponse =
- error instanceof HttpClientError && error.status === null;
+ (error instanceof HttpClientError && error.status === null) ||
+ (error instanceof Error &&
+ (error.name === "TimeoutError" || error.name === "AbortError"));
if (!noResponse) {
throw error;