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)); } }