Skip to content

Commit

Permalink
feat(error-handling): Improve error handling and messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
briansunter committed Oct 15, 2022
1 parent dcf13c0 commit 2f33d09
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,26 @@ Write a GPT-3 command in a block, then run the open `gpt3` command via the slash
See [this article for a good overview.](https://www.vox.com/future-perfect/21355768/gpt-3-ai-openai-turing-test-language)

### Errors
I see an "OpenAI Plugin Error"
#### OpenAI Quota Reached

Your free trial is over, or you've run out of tokens. You can refill your tokens [here](https://beta.openai.com/account/billing/overview).
#### `OpenAI Rate Limited`
OpenAI has limits on how often you can call them. If you get this error, you'll need to wait a bit before trying again. See this [article](https://help.openai.com/en/articles/5955598-is-api-usage-subject-to-any-rate-limits) for more info on the rate limits. You can call it faster if you have a paid account.
#### `Refused to set unsafe header "User Agent"`
This error doesn't cause any issues besides the error message in the console. It's a known issue with the OpenAI API. See [this issue](https://github.com/openai/openai-node/issues/6) for more details. I'm working on a PR to their library to support browser usage. Ignore this error for now.

### Debugging
![openai](docs/openai-error.png)]

- Open the developer tools (Menu -> View -> Toggle Developer tools)

- Check the console logs for error messages.

![](docs/debug.png)

![](docs/response.png)

- See if you can figure out the error on your own. Maybe you had a network issue if it says something like "timed out." Sometimes the OpenAI API has issues. You also have a limited number of tokens, so you may run out and need to refill.
#### OpenAI Quota Reached

Your free trial is over, or you've run out of tokens. You can refill your tokens [here](https://beta.openai.com/account/billing/overview).
#### `OpenAI Rate Limited`
OpenAI has limits on how often you can call them. If you get this error, you'll need to wait a bit before trying again. See this [article](https://help.openai.com/en/articles/5955598-is-api-usage-subject-to-any-rate-limits) for more info on the rate limits. You can call it faster if you have a paid account.
#### `Refused to set unsafe header "User Agent"`
This error doesn't cause any issues besides the error message in the console. It's a known issue with the OpenAI API. See [this issue](https://github.com/openai/openai-node/issues/6) for more details. I'm working on a PR to their library to support browser usage. Ignore this error for now.

- If you can't figure it out based on the error message and it doesn't go away. Make an issue on GitHub.
### Prerequisites
Expand Down

0 comments on commit 2f33d09

Please sign in to comment.