Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All unrecognized errors show up as API key issues #12

Open
eai04191 opened this issue Mar 21, 2023 · 0 comments
Open

All unrecognized errors show up as API key issues #12

eai04191 opened this issue Mar 21, 2023 · 0 comments

Comments

@eai04191
Copy link

} catch (error: any) {
if (error.toJSON().message === "Network Error") {
notifications.show({
title: "Error",
color: "red",
message: "No internet connection.",
});
} else {
notifications.show({
title: "Error",
color: "red",
message:
"You OpenAI API Key is not active or has expired. Please set a new API Key",
});
}
} finally {

As written here, all errors in sending chats will appear as API key issues, except for network errors.
For example, if the sentence is too long, it is known that code: "context_length_exceeded" will be returned, so it can be determined.
The message will return the current number of tokens, so telling the user to reduce it will make the app more user-friendly.

I can create a PR if needed, but it may take some time.

@Dusky Dusky mentioned this issue Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant