From 10656c59559749830603807cf39bea14d3467b16 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Mon, 7 Oct 2019 16:46:05 +0100 Subject: [PATCH] Updates Blob Exception Blob was raising general Exceptions when a ValueError should be a better match --- apps/cli/blob.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/cli/blob.py b/apps/cli/blob.py index 9911011..d2bf390 100644 --- a/apps/cli/blob.py +++ b/apps/cli/blob.py @@ -14,13 +14,13 @@ 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: {}" - .format(self.hash_function, 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, - SUPPORTED_CIPHERS)) + raise ValueError("Cipher not supported ({}). Supported ciphers: {}".format(self.hash_function, + SUPPORTED_CIPHERS)) def encrypt(self, tx_id): # Transaction to be encrypted