diff --git a/cli/sawtooth_cli/identity.py b/cli/sawtooth_cli/identity.py index 10034f4b89..af46e1da29 100644 --- a/cli/sawtooth_cli/identity.py +++ b/cli/sawtooth_cli/identity.py @@ -560,7 +560,7 @@ def _read_signer(key_filename): try: private_key = Secp256k1PrivateKey.from_hex(signing_key) - except ParseError: + except ParseError as e: try: private_key = Secp256k1PrivateKey.from_wif(signing_key) except ParseError: diff --git a/cli/sawtooth_cli/sawset.py b/cli/sawtooth_cli/sawset.py index 13fdcb0ad8..0207576bd8 100644 --- a/cli/sawtooth_cli/sawset.py +++ b/cli/sawtooth_cli/sawset.py @@ -286,7 +286,7 @@ def _read_signer(key_filename): except ParseError: try: private_key = Secp256k1PrivateKey.from_wif(signing_key) - except ParseError: + except ParseError as e: raise CliException('Unable to read key in file: {}'.format(str(e))) context = create_context('secp256k1') diff --git a/consensus/poet/cli/sawtooth_poet_cli/registration.py b/consensus/poet/cli/sawtooth_poet_cli/registration.py index 2462ccbf8f..40eb144297 100644 --- a/consensus/poet/cli/sawtooth_poet_cli/registration.py +++ b/consensus/poet/cli/sawtooth_poet_cli/registration.py @@ -254,7 +254,7 @@ def _read_signer(key_filename): except ParseError: try: private_key = Secp256k1PrivateKey.from_wif(signing_key) - except ParseError: + except ParseError as e: raise CliException('Unable to read key in file: {}'.format(str(e))) context = create_context('secp256k1') diff --git a/validator/sawtooth_validator/server/keys.py b/validator/sawtooth_validator/server/keys.py index 26e5a4434a..aaf5ba1cbf 100644 --- a/validator/sawtooth_validator/server/keys.py +++ b/validator/sawtooth_validator/server/keys.py @@ -57,7 +57,7 @@ def load_identity_signer(key_dir, key_name): except signing.ParseError: try: private_key = Secp256k1PrivateKey.from_wif(private_key_str) - except signing.ParseError: + except signing.ParseError as e: raise LocalConfigurationError( "Invalid key in file {}: {}".format(key_path, str(e)))