refactor: use CliError subclasses in adapters (first batch)#365
Closed
refactor: use CliError subclasses in adapters (first batch)#365
Conversation
…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.
Replace raw Error throws with appropriate CliError subclasses: - chatgpt/status.ts: ConfigError for platform limitation - chatgpt/ask.ts: ConfigError for platform limitation - chatgpt/new.ts: ConfigError for platform limitation - chatgpt/read.ts: ConfigError for platform limitation, CommandExecutionError for read failures This enables better error handling and user-facing error messages.
01130ad to
4945f10
Compare
Owner
Author
|
Superseded by rebased version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace raw
Errorthrows with appropriateCliErrorsubclasses in several adapters. This enables better error handling and user-facing error messages through the framework's error rendering system.Changes
LinkedIn adapters
AuthRequiredError,EmptyResultErrorArgumentError,CommandExecutionErrorTwitter adapters
AuthRequiredError,EmptyResultErrorAuthRequiredError,CommandExecutionErrorReddit adapters
CommandExecutionErrorfor API-related errorsImpact
Before: Raw errors with generic messages
After: Structured errors with:
Next Steps
This is a first batch covering high-usage adapters. ~120 more adapters still need similar treatment for consistency across the codebase.
Testing