Fixed type of error returned by StorageAccess

This commit is contained in:
Adolfo Gómez García 2020-07-22 06:38:35 +02:00
parent 03e3517baf
commit 8a49e7c437

View File

@ -84,7 +84,7 @@ class StorageAsDict(MutableMapping):
def __getitem__(self, key: str) -> typing.Any:
if not isinstance(key, str):
raise ValueError('Key must be str, {} found'.format(type(key)))
raise TypeError('Key must be str, {} found'.format(type(key)))
dbk = self._key(key)
logger.debug('Getitem: %s', dbk)
@ -96,7 +96,7 @@ class StorageAsDict(MutableMapping):
def __setitem__(self, key: str, value: typing.Any) -> None:
if not isinstance(key, str):
raise ValueError('Key must be str type, {} found'.format(type(key)))
raise TypeError('Key must be str type, {} found'.format(type(key)))
dbk = self._key(key)
logger.debug('Setitem: %s = %s', dbk, value)