mirror of
https://github.com/derrod/legendary.git
synced 2024-05-19 03:53:26 +12:00
Catch exceptions when writing metadata to file
This commit is contained in:
parent
a70ac2d1f9
commit
364afd0ba5
|
@ -229,7 +229,11 @@ class LGDLFS:
|
|||
json_meta = meta.__dict__
|
||||
self._game_metadata[app_name] = json_meta
|
||||
meta_file = os.path.join(self.path, 'metadata', f'{app_name}.json')
|
||||
json.dump(json_meta, open(meta_file, 'w'), indent=2, sort_keys=True)
|
||||
try:
|
||||
json.dump(json_meta, open(meta_file, 'w'), indent=2, sort_keys=True)
|
||||
except OSError as e:
|
||||
self.log.error(f'Unable to write metadata to file: "{meta_file}" ! '
|
||||
f'(Error: {repr(e)})')
|
||||
|
||||
def delete_game_meta(self, app_name):
|
||||
if app_name not in self._game_metadata:
|
||||
|
|
Loading…
Reference in a new issue