Browse Source

Adds custom message for 404 on model access

main
Eric Amodio 1 year ago
parent
commit
628dfe0d37
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/ai/openaiProvider.ts

+ 5
- 0
src/ai/openaiProvider.ts View File

@ -142,6 +142,11 @@ export class OpenAIProvider implements AIProvider {
if (!rsp.ok) {
debugger;
if (rsp.status === 404) {
throw new Error(
`Unable to explain commit: Your API key doesn't seem to have access to the selected '${model}' model`,
);
}
if (rsp.status === 429) {
throw new Error(
`Unable to explain commit: (${this.name}:${rsp.status}) Too many requests (rate limit exceeded) or your API key is associated with an expired trial`,

Loading…
Cancel
Save