Open
Conversation
- RPC errors in HTTP error bodies are now correctly classified as RPC_ERROR instead of NETWORK_ERROR (e.g. fake_method no longer says "check your internet connection") - DNS failures for invalid network slugs now report "Unknown network" instead of a generic network error - errRPC() includes contextual hints for standard JSON-RPC error codes (-32601 "Method not supported", -32602 "Invalid parameters", etc.) - block command validates negative numbers client-side - Unknown CLI commands now say "Unknown command" instead of "too many arguments" - AdminClient differentiates 401 (invalid key) from 403 (access denied) and parses the 403 response body for a reason Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous approach in formatCommanderError would have rewritten ALL "too many arguments (expected 0)" errors as "unknown command" — including legitimate cases from zero-argument subcommands. Move the detection to the root program action where excess args unambiguously mean an unknown command was typed. Uses allowExcessArguments(true) so Commander doesn't fire its own error first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Node's fetch wraps DNS errors in a TypeError where .message is just "fetch failed" and the actual ENOTFOUND detail is in .cause.message. Now checks both err.message and err.cause for DNS-related patterns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
blakecduncan
approved these changes
Mar 24, 2026
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
Phase 1 of the CLI feedback implementation plan — fixes the most impactful error handling bugs that erode user trust by showing misleading messages.
fake_method) are now correctly classified asRPC_ERRORinstead ofNETWORK_ERRORwith "check your internet connection"--networkvalues now say "Unknown network" with a hint to runalchemy network list, instead of a generic network errorerrRPC()now includes contextual hints for standard JSON-RPC codes (-32601→ "Method not supported",-32602→ "Invalid parameters", etc.)block -1now rejects client-side with "Block number must be non-negative" instead of sending to RPC and getting a cryptic erroralchemy abcdnow says "Unknown command 'abcd'" instead of "too many arguments. Expected 0 arguments but got 1"AdminClientnow differentiates invalid keys (401) from access denied (403), parsing the 403 body for a reason — so valid keys hitting tier restrictions get "Access denied: ..." instead of "Invalid access key"Test plan
pnpm run buildpassespnpm test— all 223 tests pass (7 new tests added)alchemy rpc fake_method→ RPC_ERROR with "Method not supported" hintalchemy block -1→ INVALID_ARGS "Block number must be non-negative"alchemy --network fake-network balance 0x...→ INVALID_ARGS "Unknown network"alchemy abcd→ "Unknown command 'abcd'"🤖 Generated with Claude Code