Ver código fonte

Adds custom message for 404 on model access

main
Eric Amodio 1 ano atrás
pai
commit
628dfe0d37
1 arquivos alterados com 5 adições e 0 exclusões
  1. +5
    -0
      src/ai/openaiProvider.ts

+ 5
- 0
src/ai/openaiProvider.ts Ver arquivo

@ -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`,

Carregando…
Cancelar
Salvar