No description
Find a file
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
.github/workflows Remove more unused 2025-03-13 01:07:41 -04:00
src Improve error handling for OpenAI API calls 2025-10-12 19:44:23 -04:00
.editorconfig Initial commit 2024-12-04 19:07:41 -05:00
.gitignore Initial commit 2024-12-04 19:07:41 -05:00
.npmrc Initial commit 2024-12-04 19:07:41 -05:00
esbuild.config.mjs Reorganize the code for better maintenance 2025-03-13 01:30:00 -04:00
LICENSE Initial commit 2024-12-04 19:20:09 -05:00
manifest.json New release - Linkback to source notes, by @philoserf - PR 5 2025-03-18 13:59:19 -04:00
package-lock.json Remove the unused 2025-03-13 00:59:55 -04:00
package.json Remove the unused 2025-03-13 00:59:55 -04:00
README.md Reformat files with tools 2025-03-13 00:44:01 -04:00
tsconfig.json Modernize tsconfig with related code changes 2025-03-13 01:06:02 -04:00
version-bump.mjs Initial commit 2024-12-04 19:07:41 -05:00
versions.json New release - Linkback to source notes, by @philoserf - PR 5 2025-03-18 13:59:19 -04:00

Atomizer: Turn notes into ideas

NOTE: THIS PLUGIN IS CURRENTLY IN ITS EARLY STAGES OF DEVELOPMENT. UPDATES WILL BE SPARSE UNTIL I HAVE MORE TIME TO DEDICATE TO ADDING FEATURES! THANK YOU FOR THE FEEDBACK SO FAR! :)

This plugin helps break down large notes into smaller, "atomic" style notes and ideas, using the OpenAI API.

Requirements

  • An OpenAI API key is required for full functionality

Usage

  • Set your OpenAI API key in settings.
  • Open the command palette and select "Atomize Selected Note" to process the currently selected note; Alternatively, you can use the icon in the left sidebar.
  • Sends selected note to OpenAI for processing, where it will be broken down into "atomic notes" that aim to extract key insights from the original note.
  • Frontmatter will be added to each new note, including the date and any custom tags you've configured from the settings menu.

Models supported

  • gpt-4o-mini
  • gpt-4o

Network Usage Disclosure

This plugin makes network requests to:

  • OpenAI API (api.openai.com) for generating atomic notes from your content
  • Your notes' content is sent to OpenAI for processing. Please review OpenAI's privacy policy.