From 0bf5e005b38831e74ff77c0a1ebf54288c7ebf90 Mon Sep 17 00:00:00 2001 From: water <672684719@qq.com> Date: Wed, 29 Jul 2026 07:41:17 +0800 Subject: [PATCH] fix: normalize error message prefix to ERROR: for consistency --- tools/rustchain_wallet_cli.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/rustchain_wallet_cli.py b/tools/rustchain_wallet_cli.py index 62238658f..8f17efffd 100755 --- a/tools/rustchain_wallet_cli.py +++ b/tools/rustchain_wallet_cli.py @@ -210,14 +210,14 @@ def _sign_transfer( def cmd_create(args): if Mnemonic is None: - print("Error: missing dependency 'mnemonic'. Install: python3 -m pip install mnemonic", file=sys.stderr) + print("ERROR: missing dependency 'mnemonic'. Install: python3 -m pip install mnemonic", file=sys.stderr) return EXIT_USAGE_ERROR wallet_name = args.name or f"wallet-{int(time.time())}" password = _read_password("Set wallet password: ", "RUSTCHAIN_WALLET_PASSWORD") confirm = _read_password("Confirm password: ", "RUSTCHAIN_WALLET_PASSWORD_CONFIRM") if password != confirm: - print("Error: password mismatch", file=sys.stderr) + print("ERROR: password mismatch", file=sys.stderr) return EXIT_USAGE_ERROR m = Mnemonic("english") @@ -246,7 +246,7 @@ def cmd_create(args): def cmd_import(args): if Mnemonic is None: - print("Error: missing dependency 'mnemonic'. Install: python3 -m pip install mnemonic", file=sys.stderr) + print("ERROR: missing dependency 'mnemonic'. Install: python3 -m pip install mnemonic", file=sys.stderr) return EXIT_USAGE_ERROR phrase = args.mnemonic.strip().lower() @@ -254,7 +254,7 @@ def cmd_import(args): password = _read_password("Set wallet password: ", "RUSTCHAIN_WALLET_PASSWORD") confirm = _read_password("Confirm password: ", "RUSTCHAIN_WALLET_PASSWORD_CONFIRM") if password != confirm: - print("Error: password mismatch", file=sys.stderr) + print("ERROR: password mismatch", file=sys.stderr) return EXIT_USAGE_ERROR priv_hex, pub_hex = _derive_ed25519_from_mnemonic(phrase) @@ -292,7 +292,7 @@ def _safe_json(r: "requests.Response") -> "tuple[dict | list | None, int]": return r.json(), EXIT_SUCCESS if r.ok else EXIT_BAD_RESPONSE except Exception: print( - f"Error: Server returned HTTP {r.status_code} with non-JSON body" + f"ERROR: Server returned HTTP {r.status_code} with non-JSON body" f" (check node URL / connectivity)", file=sys.stderr, ) @@ -304,7 +304,7 @@ def _safe_json_object(r: "requests.Response") -> "tuple[dict | None, int]": if data is None: return None, rc if not isinstance(data, dict): - print("Error: Server returned JSON but not an object", file=sys.stderr) + print("ERROR: Server returned JSON but not an object", file=sys.stderr) return None, EXIT_BAD_RESPONSE return data, rc @@ -478,7 +478,7 @@ def main(): try: return args.func(args) except Exception as e: - print(f"Error: {e}", file=sys.stderr) + print(f"ERROR: {e}", file=sys.stderr) return EXIT_UNKNOWN_ERROR