paritytech / paritytech/polkadot-cli
feat: better error messages for incomplete/ambiguous target grammar
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 2
- Avg merge
- 12h 35m
- Merged PRs (30d)
- 4
Description
Summary
parseTarget errors are generic and unhelpful. When a user types dot tx Balances, the error says "Expected format: Pallet.Item" but doesn't suggest how to discover available calls.
Current Behavior
$ dot tx Balances
Error: Expected format: Pallet.Item
Expected Behavior
$ dot tx Balances
Error: Expected format: Pallet.call_name (e.g., Balances.transfer_allow_death)
Hint: run "dot inspect Balances" to see available calls
$ dot tx Balancez.transfer
Error: Unknown pallet "Balancez". Did you mean "Balances"?
Available pallets: Balances, System, Staking, ...
Proposed Changes
src/utils/parse-target.ts: Add contextual hints to error messages (e.g., suggestdot inspect <Pallet>to discover items)src/commands/tx.ts: Enhance "Unknown pallet" errors with fuzzy suggestions from chain metadatasrc/commands/query.ts: Same fuzzy suggestion treatment for storage queries
Dependencies
- Depends on Issue tracking
inspectlisting calls (#79 or equivalent) — so the hint actually shows useful info.
Related Issues
- #46 (camelCase normalization) — related input handling improvement.
Priority
P2 — Polish after inspect shows calls. Quick win (size S).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/utils/parse-target.ts, then review src/commands/tx.ts and src/commands/query.ts for the existing target and unknown-pallet errors. Check Issue #79 or its equivalent first, since the inspect listing is a dependency for the suggested hint. Done means incomplete targets explain the grammar, unknown pallets offer fuzzy suggestions and available pallets, and storage queries receive the same treatment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100