mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Updates Blob Exception
Blob was raising general Exceptions when a ValueError should be a better match
This commit is contained in:
@@ -14,13 +14,13 @@ class Blob:
|
|||||||
|
|
||||||
# FIXME: We only support SHA256 for now
|
# FIXME: We only support SHA256 for now
|
||||||
if self.hash_function.upper() not in SUPPORTED_HASH_FUNCTIONS:
|
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))
|
.format(self.hash_function, SUPPORTED_HASH_FUNCTIONS))
|
||||||
|
|
||||||
# FIXME: We only support AES-GCM-128 for now
|
# FIXME: We only support AES-GCM-128 for now
|
||||||
if self.cipher.upper() not in SUPPORTED_CIPHERS:
|
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))
|
SUPPORTED_CIPHERS))
|
||||||
|
|
||||||
def encrypt(self, tx_id):
|
def encrypt(self, tx_id):
|
||||||
# Transaction to be encrypted
|
# Transaction to be encrypted
|
||||||
|
|||||||
Reference in New Issue
Block a user