Island: Remove SizeError and use ValueError

This commit is contained in:
Shreya Malviya 2022-07-19 18:59:54 +05:30
parent 7f60fb4419
commit 74cb986e36
3 changed files with 1 additions and 11 deletions

View File

@ -15,4 +15,3 @@ from .data_store_encryptor import (
reset_datastore_encryptor,
)
from .encryption_key_types import EncryptionKey32Bytes
from .errors import SizeError

View File

@ -1,9 +1,6 @@
from .errors import SizeError
class EncryptionKey32Bytes(bytes):
def __init__(self, key: bytes):
if len(key) == 32:
self.key = key
else:
raise SizeError("Key size should be 32 bytes.")
raise ValueError("Key size should be 32 bytes.")

View File

@ -1,6 +0,0 @@
class SizeError(Exception):
"""
Raised when an argument is not of the expected size during object creation.
"""
pass