Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add vercel error code link on the error message

adilson81dff2d7c1fc
diff --git a/backend/src/services/secret-sync/vercel/vercel-sync-fns.test.ts b/backend/src/services/secret-sync/vercel/vercel-sync-fns.test.ts
index ec5797460d..ed7eb81e92 100644
--- a/backend/src/services/secret-sync/vercel/vercel-sync-fns.test.ts
+++ b/backend/src/services/secret-sync/vercel/vercel-sync-fns.test.ts
@@ -100,11 +100,17 @@ describe("Vercel errors that retrying can't fix", () => {
])("sets shouldRetry and the message when a create fails with %s", async (code, shouldRetry, message) => {
get.mockResolvedValue({ data: { envs: [] } });
post.mockRejectedValue(vercelError(code));
- await expect(VercelSyncFns.syncSecrets(sync, payloadOf(["API_KEY"]))).rejects.toMatchObject({
+ const error = await VercelSyncFns.syncSecrets(sync, payloadOf(["API_KEY"])).catch((err: unknown) => err);
+ expect(error).toMatchObject({
shouldRetry,
secretKey: "API_KEY",
message: (message ? expect.stringContaining(message) : expect.any(String)) as string
});
+ if (message) {
+ expect(error).toMatchObject({
+ message: expect.stringContaining("https://vercel.com/docs/rest-api/errors")
+ });
+ }
});
it("stops retrying a read that fails with a listed code", async () => {
get.mockRejectedValue(vercelError("bad_request"));
diff --git a/backend/src/services/secret-sync/vercel/vercel-sync-fns.ts b/backend/src/services/secret-sync/vercel/vercel-sync-fns.ts
index e2fe708cf5..7e644ecc92 100644
--- a/backend/src/services/secret-sync/vercel/vercel-sync-fns.ts
+++ b/backend/src/services/secret-sync/vercel/vercel-sync-fns.ts
@@ -27,11 +27,11 @@ const RATE_LIMIT_DELAY_MS = 60000;
// failure. Each maps to the message shown as the sync's error.
const NON_RETRYABLE_VERCEL_ERRORS: Record<string, string> = {
bad_request:
- "Vercel rejected this environment variable as invalid, for example because its name and value together are larger than Vercel's 65,535-byte limit. Fix the secret in Infisical, then sync again.",
+ "Vercel rejected this environment variable as invalid, for example because its name and value together are larger than Vercel's 65,535-byte limit. Fix the secret in Infisical, then sync again. Check the error code on https://vercel.com/docs/rest-api/errors.",
env_key_invalid_characters:
- "Vercel rejected this environment variable's name. Names can only contain letters, digits and underscores, and cannot start with a digit. Rename the secret or change the sync's key schema, then sync again.",
+ "Vercel rejected this environment variable's name. Names can only contain letters, digits and underscores, and cannot start with a digit. Rename the secret or change the sync's key schema, then sync again. Check the error code on https://vercel.com/docs/rest-api/errors.",
envs_size_too_large:
- "Vercel has no space left for environment variables in this project. Remove environment variables you no longer need in Vercel, then sync again."
+ "Vercel has no space left for environment variables in this project. Remove environment variables you no longer need in Vercel, then sync again. Check the error code on https://vercel.com/docs/rest-api/errors."
};
const sleep = async (ms: number) =>