Skip to content

refactor: use CliError subclasses in remaining adapters#367

Merged
jackwener merged 5 commits intomainfrom
refactor/adapter-cli-errors
Mar 24, 2026
Merged

refactor: use CliError subclasses in remaining adapters#367
jackwener merged 5 commits intomainfrom
refactor/adapter-cli-errors

Conversation

@jackwener
Copy link
Owner

Continues error refactor work for bilibili and medium adapters. 223 tests pass.

Replace raw Error throws with appropriate CliError subclasses:
- linkedin/timeline.ts: AuthRequiredError, EmptyResultError
- linkedin/search.ts: ArgumentError, CommandExecutionError

This enables better error handling and user-facing error messages.
Replace raw Error throws with appropriate CliError subclasses:
- twitter/trending.ts: AuthRequiredError, EmptyResultError
- twitter/bookmarks.ts: AuthRequiredError, CommandExecutionError

This enables better error handling and user-facing error messages.
Replace raw Error throws with appropriate CliError subclasses:
- reddit/read.ts: CommandExecutionError for API-related errors

This enables better error handling and user-facing error messages.
- linkedin/timeline: AuthRequiredError, EmptyResultError
- linkedin/search: ArgumentError, CommandExecutionError
- bilibili/subtitle: AuthRequiredError, CommandExecutionError, EmptyResultError, SelectorError
- bilibili/following: CommandExecutionError
- medium/shared: CommandExecutionError
- twitter/delete, twitter/unfollow: CommandExecutionError

This allows the top-level error handler to render consistent,
helpful output with emoji-coded severity and actionable hints.
…ters

Replace raw Error throws with appropriate CliError subclasses:
- youtube/transcript.ts: CommandExecutionError, EmptyResultError
- youtube/video.ts: CommandExecutionError
- bilibili/utils.ts: EmptyResultError
- boss/send.ts: EmptyResultError, SelectorError
- boss/mark.ts: ArgumentError, EmptyResultError

This enables better error handling and user-facing error messages.
@jackwener
Copy link
Owner Author

Review summary:

Priority Issue File Action
P2 PR body /汇报描述的范围比实际 diff 小,实际还包含 boss / youtube / twitter / linkedin / reddit 等 adapter 的 CliError 收口 PR metadata Note only
Error normalization direction is correct changed adapters Keep

I checked the actual diff and validated the branch on latest main:

  • npm run typecheck
  • npm test

Result: 223/223 tests passed.

No blocker from my side. The only follow-up is process-level: keep the PR description aligned with the real changed files next time, because this branch touches more adapters than the summary says.

@jackwener jackwener merged commit e916c16 into main Mar 24, 2026
12 of 13 checks passed
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