feat: add error handling, validation, timeout, and verbose mode#28
Merged
feat: add error handling, validation, timeout, and verbose mode#28
Conversation
- Handle network errors gracefully in CLI with structured JSON on stderr - Add NaN-guarding parseIntOption/parseFloatOption helpers; replace all raw parseInt/parseFloat calls across 8 command files - Fix empty object edge case in table formatter (Math.max on empty array) - Add configurable fetch timeout (default 30s) with --timeout CLI option - Add --verbose flag for request/response debugging on stderr - Extend post() to accept optional body and query params - Document cursor vs next parameter mapping in tokens API Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
TypeError(DNS/timeout/connection failures) and other non-API errors, outputting structured JSON to stderr instead of raw stack tracesparseIntOption/parseFloatOptionhelpers replace all 21 rawNumber.parseInt/Number.parseFloatcalls across 8 command files — passing--limit abcnow shows a clear error instead of silently sending NaN to the APIformatTable({})returns"(empty)"instead of crashing onMath.max(...[])AbortSignal.timeout()(default 30s), configurable via--timeout <ms>CLI option ortimeoutin SDK config--verboseflag logs[verbose] GET <url>and[verbose] 200 OKto stderr for debuggingpost()signature: Now accepts optionalbodyandparamsarguments for SDK consumerscursorinstead ofnextTest plan
npm run test— 130 tests pass (was 115, +15 new)npm run lint— Biome passesnpm run type-check— no TypeScript errorsopensea collections get boredapeyachtclubworksopensea collections get boredapeyachtclub --verboseshows request/response on stderropensea tokens trending --limit abcshows clear error instead of silent NaNopensea collections listshows structured JSON error, not stack trace🤖 Generated with Claude Code