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

feature: handle unavailable errors #33

Open
1 task done
kerma opened this issue Jan 13, 2025 · 0 comments
Open
1 task done

feature: handle unavailable errors #33

kerma opened this issue Jan 13, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@kerma
Copy link
Contributor

kerma commented Jan 13, 2025

Did you check the docs?

  • I have read all the docs

Is your feature request related to a problem? Please describe.

There are probably a various errors which fall into the "AI API not available" bucket. These could be handled gracefully, by having an automatic retry in place, a way for a user to easily retry, or fall back to another provider.

# assistant:
Stream Error: {"type":"error","error":{"details":null,"type":"overloaded_error","message":"Overloaded"}   }
Error: {"type":"error","error":{"details":null,"type":"overloaded_error","message":"Overloaded"}   }
    at new AnthropicError (unknown)
    at new APIError (/Users/user/.config/nvim/plugged/magenta.nvim/node_modules/@anthropic-ai/sdk/error.mjs:7:9)
    at new APIConnectionError (/Users/user/.config/nvim/plugged/magenta.nvim/node_modules/@anthropic-ai/sdk/error.mjs:70:9)
    at generate (/Users/user/.config/nvim/plugged/magenta.nvim/node_modules/@anthropic-ai/sdk/error.mjs:33:24)
    at <anonymous> (/Users/user/.config/nvim/plugged/magenta.nvim/node_modules/@anthropic-ai/sdk/streaming.mjs:50:40)
    at processTicksAndRejections (native:7:39)

Describe the solution you'd like

A reasonable delay (5s) between retries would probably be the best UX, together with some indication to the user what's happening.

Describe alternatives you've considered

Capture the errors and show simpler "try again later" message to the user.

Additional context

No response

@kerma kerma added the enhancement New feature or request label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant