Bug: Improve error handling for invalid account configuration
- Dominant language
- TypeScript
- Stars
- 172
- Forks
- 207
- Avg merge
- 49m
- Merged PRs (30d)
- 1
Description
### Describe the bug
When initializing the Account SDK with invalid or incomplete configuration (e.g. missing chain, invalid signer, or unsupported account type), the resulting errors are not always clear or actionable. This makes debugging initial integration harder for developers.
### Steps
1. Install the Account SDK.
2. Initialize an account with missing or invalid configuration (for example, omit the chain or provide an unsupported signer).
3. Attempt to create or use the account.
4. Observe the thrown error or stack trace.
### Expected behavior
Expected behavior:
- SDK validates required account configuration early.
- Errors clearly state which field is missing or invalid.
- Error messages suggest how to fix the configuration issue.
Proposed solution:
- Add validation checks during account initialization.
- Throw descriptive, user-facing errors instead of generic exceptions.
- Document required and optional configuration fields with examples.
Acceptance criteria:
- Invalid configuration fails fast with a clear error.
- Error message explicitly references the problematic field.
- Documentation includes a minimal valid account setup example.
### Version
_No response_
### Additional info
_No response_
### Desktop
_No response_
### Smartphone
_No response_
Contributor guide
Research direction
Start by locating the Account SDK initialization entry point and the configuration types used for chain, signer, and account type validation. Reproduce the listed invalid configurations and inspect the existing thrown errors. Done means invalid setup fails early, identifies the problematic field, suggests a fix, and includes the minimal valid account example in the documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100