瀏覽代碼

Adds custom message for 404 on model access

main
Eric Amodio 1 年之前
父節點
當前提交
628dfe0d37
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. +5
    -0
      src/ai/openaiProvider.ts

+ 5
- 0
src/ai/openaiProvider.ts 查看文件

@ -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…
取消
儲存