binxly_Atomizer/src
Mark Ayers 1bdc85e085 Improve error handling for OpenAI API calls
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>
2025-10-12 19:44:23 -04:00
..
main.ts Add a link back to the original 2025-03-13 02:09:02 -04:00
modals.ts Reorganize the code for better maintenance 2025-03-13 01:30:00 -04:00
notes-manager.ts Reorganize the code for better maintenance 2025-03-13 01:30:00 -04:00
openai-service.ts Improve error handling for OpenAI API calls 2025-10-12 19:44:23 -04:00
settings.ts Reorganize the code for better maintenance 2025-03-13 01:30:00 -04:00
types.ts Improve error handling for OpenAI API calls 2025-10-12 19:44:23 -04:00
utils.ts Reorganize the code for better maintenance 2025-03-13 01:30:00 -04:00