More error messages for config setting
This commit is contained in:
@@ -76,7 +76,7 @@ def _config_set_in_scope(scope: dict, key: str, value, cfg_type: type) -> str:
|
|||||||
if type(value) == cfg_type:
|
if type(value) == cfg_type:
|
||||||
scope[key] = value
|
scope[key] = value
|
||||||
success = True
|
success = True
|
||||||
if type(value) == str:
|
elif type(value) == str:
|
||||||
if cfg_type == int:
|
if cfg_type == int:
|
||||||
scope[key] = int(value)
|
scope[key] = int(value)
|
||||||
success = True
|
success = True
|
||||||
@@ -93,6 +93,10 @@ def _config_set_in_scope(scope: dict, key: str, value, cfg_type: type) -> str:
|
|||||||
return 'Unable to convert given value to a boolean!'
|
return 'Unable to convert given value to a boolean!'
|
||||||
scope[key] = value
|
scope[key] = value
|
||||||
success = True
|
success = True
|
||||||
|
else:
|
||||||
|
return 'Unknown config type: ' + str(cfg_type)
|
||||||
|
else:
|
||||||
|
return 'Unknown given value type: ' + str(type(value))
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
success = False
|
success = False
|
||||||
if success:
|
if success:
|
||||||
|
|||||||
Reference in New Issue
Block a user