mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Improve value error exception message
This commit is contained in:
parent
1ed281e7c4
commit
af80565acd
|
@ -85,7 +85,9 @@ class CONFIG:
|
|||
for section in data:
|
||||
for setting in data[section]:
|
||||
if not isinstance(data[section][setting], self.config_types[section][setting]):
|
||||
raise ValueError(f"{section}.{setting} must be {self.config_types[section][setting]}")
|
||||
message = (f"{section}.{setting} must be {self.config_types[section][setting]}."
|
||||
f" '{data[section][setting]}' {type(data[section][setting])} given.")
|
||||
raise ValueError(message)
|
||||
|
||||
# Handle special setting data type conversion
|
||||
# is_writing means data from a dict being writen to the config file
|
||||
|
|
Loading…
Reference in a new issue