From 8a49e7c43797ab35c5c5e441433d00110d04cbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 22 Jul 2020 06:38:35 +0200 Subject: [PATCH] Fixed type of error returned by StorageAccess --- server/src/uds/core/util/storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/uds/core/util/storage.py b/server/src/uds/core/util/storage.py index f3ccf7b8..16e53929 100644 --- a/server/src/uds/core/util/storage.py +++ b/server/src/uds/core/util/storage.py @@ -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)