Updates Blob Exception

Blob was raising general Exceptions when a ValueError should be a better match
This commit is contained in:
Sergi Delgado Segura
2019-10-07 16:46:05 +01:00
parent 88532f7345
commit 10656c5955

View File

@@ -14,12 +14,12 @@ class Blob:
# FIXME: We only support SHA256 for now
if self.hash_function.upper() not in SUPPORTED_HASH_FUNCTIONS:
raise Exception("Hash function not supported ({}). Supported Hash functions: {}"
raise ValueError("Hash function not supported ({}). Supported Hash functions: {}"
.format(self.hash_function, SUPPORTED_HASH_FUNCTIONS))
# FIXME: We only support AES-GCM-128 for now
if self.cipher.upper() not in SUPPORTED_CIPHERS:
raise Exception("Cipher not supported ({}). Supported ciphers: {}".format(self.hash_function,
raise ValueError("Cipher not supported ({}). Supported ciphers: {}".format(self.hash_function,
SUPPORTED_CIPHERS))
def encrypt(self, tx_id):