Skip to content

refactor: use CliError subclasses in twitter, reddit, v2ex, substack adapters#374

Closed
jackwener wants to merge 3 commits intomainfrom
refactor/clierror-twitter-reddit-v2ex-substack
Closed

refactor: use CliError subclasses in twitter, reddit, v2ex, substack adapters#374
jackwener wants to merge 3 commits intomainfrom
refactor/clierror-twitter-reddit-v2ex-substack

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Summary

Continues CliError adoption for high-priority adapters.

Changes

  • twitter (20 files): CommandExecutionError (browser required), AuthRequiredError (login checks), SelectorError (UI elements)
  • reddit (6 files): CommandExecutionError (browser required, API errors)
  • v2ex (3 files): CommandExecutionError (browser required, API errors), SelectorError (UI elements)
  • substack (2 files): CommandExecutionError (browser required, HTTP errors)

27 files changed, 57 insertions(+), 30 deletions(-)

Test

  • 223 tests pass
  • Typecheck clean

🤖 Generated with Claude Code

…adapters

- twitter: CommandExecutionError (browser required), AuthRequiredError (login), SelectorError (UI elements)
- reddit: CommandExecutionError (browser required, API errors)
- v2ex: CommandExecutionError (browser required, API errors), SelectorError (UI elements)
- substack: CommandExecutionError (browser required, HTTP errors)

30 files changed, 223 tests pass.
Refactored 37 adapter files to use appropriate CliError subclasses:
- AuthRequiredError for authentication/login failures
- CommandExecutionError for API/browser execution failures
- SelectorError for missing UI elements
- ArgumentError for invalid input arguments
- ConfigError for configuration errors
- EmptyResultError for no results scenarios

Files refactored:
- twitter: profile, article, thread, search (4 files)
- boss: common, chatmsg, detail, exchange, greet, invite, resume (7 files)
- xiaohongshu: publish, user, creator-* (7 files)
- antigravity: send, read, model, new, serve (5 files)
- coupang: add-to-cart, search (2 files)
- doubao-app: send, ask (2 files)
- chaoxing: exams (1 file)
- discord-app: send, search (2 files)
- notion: write (1 file)
- douban: utils (1 file)
- sinablog: search (1 file)
- substack: search, shared (2 files)
- v2ex: notifications (1 file)
- barchart: flow (1 file)

All 223 tests pass, typecheck clean.
- reddit/saved.ts, reddit/upvoted.ts: Use CommandExecutionError for API errors
- chaoxing/assignments.ts: Use EmptyResultError for course not found
jackwener added a commit that referenced this pull request Mar 24, 2026
Replace raw Error throws with appropriate CliError subclasses in:
- antigravity (5 files): SelectorError for UI elements
- barchart (1 file): AuthRequiredError for login issues
- boss (7 files): AuthRequiredError, CommandExecutionError, SelectorError, EmptyResultError
- chaoxing (1 file): CommandExecutionError
- coupang (2 files): ArgumentError, CommandExecutionError
- discord-app (2 files): SelectorError for UI elements
- douban (1 file): EmptyResultError
- doubao-app (2 files): CommandExecutionError, SelectorError
- notion (1 file): SelectorError for UI elements
- sinablog (1 file): CommandExecutionError
- xiaohongshu (7 files): AuthRequiredError, CommandExecutionError, EmptyResultError, ArgumentError, TimeoutError

Based on work from @coding-claude-opus (PR #374), excludes social adapters
already covered by PR #375.
jackwener added a commit that referenced this pull request Mar 24, 2026
Replace raw Error throws with appropriate CliError subclasses in:
- antigravity (5 files): SelectorError for UI elements
- barchart (1 file): AuthRequiredError for login issues
- boss (7 files): AuthRequiredError, CommandExecutionError, SelectorError, EmptyResultError
- chaoxing (1 file): CommandExecutionError
- coupang (2 files): ArgumentError, CommandExecutionError
- discord-app (2 files): SelectorError for UI elements
- douban (1 file): EmptyResultError
- doubao-app (2 files): CommandExecutionError, SelectorError
- notion (1 file): SelectorError for UI elements
- sinablog (1 file): CommandExecutionError
- xiaohongshu (7 files): AuthRequiredError, CommandExecutionError, EmptyResultError, ArgumentError, TimeoutError

Based on work from @coding-claude-opus (PR #374), excludes social adapters
already covered by PR #375.
@jackwener
Copy link
Copy Markdown
Owner Author

Superseded by PR #375. Additional adapters moved to new branch refactor/clierror-additional-adapters.

@jackwener jackwener closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant