fix: user-friendly error when OpenAI org is not verified (#776)

Merged via PR triage plan. Friendly error for unverified OpenAI org. Follow-up: expand to evolve.ts, iterate.ts, variants.ts, check.ts.
This commit is contained in:
Matt Van Horn
2026-04-05 00:09:32 -07:00
committed by GitHub
parent 9ca8f1d7a9
commit f91ad61a15
+8 -1
View File
@@ -60,7 +60,14 @@ async function callImageGeneration(
if (!response.ok) {
const error = await response.text();
throw new Error(`API error (${response.status}): ${error}`);
if (response.status === 403 && error.includes("organization must be verified")) {
throw new Error(
"OpenAI organization verification required.\n"
+ "Go to https://platform.openai.com/settings/organization to verify.\n"
+ "After verification, wait up to 15 minutes for access to propagate.",
);
}
throw new Error(`API error (${response.status}): ${error.slice(0, 200)}`);
}
const data = await response.json() as any;