Commit 4a5b46f
daniel
fix: replace broad exception catches with specific exception types
Replace overly broad `except Exception` catches with specific exception types
to improve error handling clarity and debugging:
- subtensor_interface.py: Handle both TimeoutError and asyncio.TimeoutError
for substrate initialization timeout (resolves TODO comment)
- utils.py (is_valid_github_url): Catch ValueError, TypeError, AttributeError
for URL parsing exceptions (resolves TODO comment)
- utils.py (normalize_hyperparameters): Catch KeyError, ValueError, TypeError,
AttributeError for parameter normalization
- wallets.py (new_hotkey): Catch ValueError, TypeError for Keypair.create_from_uri
- wallets.py (new_coldkey): Catch ValueError, TypeError for Keypair.create_from_uri
- wallets.py (wallet_create): Catch ValueError, TypeError, KeyFileError for
keypair and wallet creation
This change improves code quality by making exception handling more explicit
and easier to debug while maintaining the same error recovery behavior.1 parent 6209a52 commit 4a5b46f
File tree
3 files changed
+6
-6
lines changed- bittensor_cli/src
- bittensor
- commands
3 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
811 | | - | |
| 811 | + | |
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
| |||
1686 | 1686 | | |
1687 | 1687 | | |
1688 | 1688 | | |
1689 | | - | |
| 1689 | + | |
1690 | 1690 | | |
1691 | 1691 | | |
1692 | 1692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| |||
0 commit comments