Commit 0777571
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 612648e commit 0777571
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 | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
| 853 | + | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| |||
1728 | 1728 | | |
1729 | 1729 | | |
1730 | 1730 | | |
1731 | | - | |
| 1731 | + | |
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
| 504 | + | |
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| |||
0 commit comments