mirror of
https://github.com/binxly/Atomizer.git
synced 2026-07-22 11:30:28 +00:00
Add comprehensive try-catch error handling around OpenAI API calls with specific error messages for common failure scenarios: - Invalid API key (401) - Rate limiting (429) - Model not found (404) - Invalid request/content too long (400) - Network errors (ENOTFOUND, ECONNREFUSED) - Generic API errors with message passthrough Remove redundant API key validation from OpenAIService - validation is already handled in main.ts before service instantiation, eliminating inconsistent error handling pattern (returning empty string vs throwing). Update APIError type to include status and code fields, and mark as deprecated since errors are now thrown as standard Error objects with user-friendly messages. Fixes H1 (Missing error handling) and H4 (Inconsistent API key check) from CODE_REVIEW.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| main.ts | ||
| modals.ts | ||
| notes-manager.ts | ||
| openai-service.ts | ||
| settings.ts | ||
| types.ts | ||
| utils.ts | ||