refactor: standardize error handling in blockchain.py CLI commands
Some checks failed
CLI Tests / test-cli (push) Failing after 12s
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

- Replace bare except with specific exception types (KeyError, AttributeError)
- Add re-raise statements to allow proper error handling upstream
- Standardize error messages in multi-chain error handling
- Improve error message consistency across all blockchain commands
This commit is contained in:
aitbc
2026-05-09 12:16:55 +02:00
parent d7a58d2e98
commit 4198d94670

View File

@@ -645,8 +645,9 @@ def peers(ctx, chain_id: str, all_chains: bool):
all_peers[chain] = {
"chain_id": chain,
"peers": [],
"error": str(e),
"available": False
"error": f"Request failed: {str(e)}",
"available": False,
"query_type": "all_chains_error"
}
# Count chains with available peers