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.

Log fetchWithRetry errors

Steven Teya45b4ba57930
diff --git a/apps/web/scripts/partners/check-pending-paypal-payouts.ts b/apps/web/scripts/partners/check-pending-paypal-payouts.ts
index fb0ec9aa91..514188f3ef 100644
--- a/apps/web/scripts/partners/check-pending-paypal-payouts.ts
+++ b/apps/web/scripts/partners/check-pending-paypal-payouts.ts
@@ -2,9 +2,6 @@ import { prisma } from "@dub/prisma";
import { CONNECT_SUPPORTED_COUNTRIES, currencyFormatter } from "@dub/utils";
import "dotenv-flow/config";
-const email = "xxx";
-
-// update partner country
async function main() {
const payouts = await prisma.payout.findMany({
where: {
diff --git a/packages/utils/src/functions/fetch-with-retry.ts b/packages/utils/src/functions/fetch-with-retry.ts
index 3c4523d690..299dd26dfb 100644
--- a/packages/utils/src/functions/fetch-with-retry.ts
+++ b/packages/utils/src/functions/fetch-with-retry.ts
@@ -50,6 +50,7 @@ export async function fetchWithRetry(
} catch {
errorMessage = `HTTP error ${response.status}`;
}
+ console.error(errorMessage);
throw new Error(errorMessage);
}
} catch (error) {
@@ -58,9 +59,9 @@ export async function fetchWithRetry(
// If this is the last retry, throw the error
if (i === maxRetries - 1) {
- throw new Error(
- `Failed after ${maxRetries} retries. Last error: ${lastError.message}`,
- );
+ const errMsg = `Failed after ${maxRetries} retries. Last error: ${lastError.message}`;
+ console.error(errMsg);
+ throw new Error(errMsg);
}
// For network errors or timeouts, wait and retry