add try except
@@ -105,6 +105,7 @@ class SkillSettings(dict):
implement the changes
TODO: allow structure changes i.e. ability to add more sections
"""
+ try:
if isfile(self._meta_path):
with open(self._meta_path, 'r') as f:
self.settings_meta = json.load(f)
@@ -127,10 +128,13 @@ class SkillSettings(dict):
self._put_metadata(settings)
else:
- try:
+ if isfile(self._meta_path):
with open(self._hashed_meta_path, 'w') as f:
- hashed_data = {"hashed_meta": hash(str(self.settings_meta))}
+ hashed_data = {
+ "hashed_meta": hash(str(self.settings_meta))
+ }
json.dump(hashed_data, f)
+
except Exception as e:
logger.error(e)
