From d99de2afd537a762ded4c7c0221599d09a658d96 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 2 Jun 2026 01:04:16 +0100 Subject: [PATCH] fix: do not log retry errors While network or server issues might result in retries, we don't want to actually log them; the final error, if it happens, will propogate anyway. --- src/_internalUtils.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/_internalUtils.ts b/src/_internalUtils.ts index 7d99326..29471b6 100644 --- a/src/_internalUtils.ts +++ b/src/_internalUtils.ts @@ -19,22 +19,12 @@ export type Brand = T & { readonly [B in Brand as `__${B}_brand`]: never; }; -const FLAKINESS_DBG = !!process.env.FLAKINESS_DBG; -export function errorText(error: Error) { - return FLAKINESS_DBG ? error.stack : error.message; -} export async function retryWithBackoff(job: () => Promise, backoff: number[] = []): Promise { for (const timeout of backoff) { try { return await job(); } catch (e: any) { - if (e instanceof AggregateError) - console.error(`[flakiness.io err]`, errorText(e.errors[0])); - else if (e instanceof Error) - console.error(`[flakiness.io err]`, errorText(e)); - else - console.error(`[flakiness.io err]`, e); await new Promise(x => setTimeout(x, timeout)); } }