Skip to content

Commit

Permalink
fix: add file not found excception catch
Browse files Browse the repository at this point in the history
  • Loading branch information
ihmily committed Sep 23, 2024
1 parent bef2c9a commit 3ba9456
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quark.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def init_config(self, _user, _pdir_id, _dir_name):
else:
_pdir_id = json_data.get('pdir_id', '0')
_dir_name = json_data.get('dir_name', '根目录')
except json.decoder.JSONDecodeError:
except (json.decoder.JSONDecodeError, FileNotFoundError):
new_config = {'user': self.user, 'pdir_id': self.pdir_id, 'dir_name': self.dir_name}
save_config(f'{CONFIG_DIR}/config.json', content=json.dumps(new_config, ensure_ascii=False))
return _user, _pdir_id, _dir_name
Expand Down

0 comments on commit 3ba9456

Please sign in to comment.