Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiMatter committed May 24, 2024
1 parent cf0925a commit 2ae7680
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_config_value(key, config_section, is_mandatory, datatype, default_value
sys.exit(0)
else:
# return default_value
print(f'The default value used for [{config_section}]: {key} is "{default_value}" (data type: {type(default_value)})')
print(f'The default value used for [{config_section}]: {key} is "{default_value}" (data type: {type(default_value).__name__})')
config_value = default_value

else:
Expand All @@ -55,6 +55,7 @@ def get_config_value(key, config_section, is_mandatory, datatype, default_value
sys.exit(0)
else:
# return default_value
print(f'The default value used for [{config_section}]: {key} is "{default_value}" (data type: {type(default_value).__name__})')
config_value = default_value

# Apply data type
Expand All @@ -65,8 +66,9 @@ def get_config_value(key, config_section, is_mandatory, datatype, default_value
config_value = json.loads(config_value)
elif config_value is not None:
config_value = cast(config_value, datatype)
except:
except Exception as e:
print(f'[ ERROR ]: The value retrieved for [{config_section}]: {key} is "{config_value}" and cannot be converted to data type {datatype}')
print(e)
sys.exit(0)
return config_value

Expand Down

0 comments on commit 2ae7680

Please sign in to comment.