mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-14 20:37:14 +01:00
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:
1 parent
9ca8f1d7a9
commit
f91ad61a15
1 file changed
+8
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user