From 8e4d836e08802bf5e2ad8574328c2cf1bab14558 Mon Sep 17 00:00:00 2001 From: Carl-Robert Linnupuu Date: Tue, 21 Feb 2023 20:07:20 +0000 Subject: [PATCH] 1.0.6 - Display proper message for insufficient quota --- build.gradle.kts | 2 +- src/main/java/ee/carlrobert/chatgpt/client/ApiClient.java | 3 +++ src/main/resources/META-INF/plugin.xml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1cfcdb49..6c263562 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } group = "ee.carlrobert" -version = "1.0.5" +version = "1.0.6" repositories { mavenCentral() diff --git a/src/main/java/ee/carlrobert/chatgpt/client/ApiClient.java b/src/main/java/ee/carlrobert/chatgpt/client/ApiClient.java index dbebcfdd..774cd8de 100644 --- a/src/main/java/ee/carlrobert/chatgpt/client/ApiClient.java +++ b/src/main/java/ee/carlrobert/chatgpt/client/ApiClient.java @@ -68,6 +68,9 @@ public final class ApiClient { onMessage.accept("Incorrect API key provided.\n" + "You can find your API key at https://platform.openai.com/account/api-keys."); throw new IllegalArgumentException(); + } else if (respInfo.statusCode() == 429) { + onMessage.accept("You exceeded your current quota, please check your plan and billing details."); + throw new RuntimeException("Insufficient quota"); } else { onMessage.accept("Something went wrong. Please try again later."); clearQueries(); diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index e58d9163..8f263472 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -31,6 +31,7 @@ +
  • 1.0.6 Display proper message for insufficient quota
  • 1.0.5 Replace TextField with TextArea, remove Tahoma font, increase response max token size
  • 1.0.4 Add support for 2023.* build
  • 1.0.3 Server-Sent Events