Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS: Vague error handling #71

Open
ntlhui opened this issue Jul 25, 2023 · 0 comments
Open

DOCS: Vague error handling #71

ntlhui opened this issue Jul 25, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ntlhui
Copy link
Contributor

ntlhui commented Jul 25, 2023

try:
if config_dir is None:
config_dir = Path(cls.dirs.user_config_dir)
config_file = config_dir.joinpath(cls.__CONFIG_NAME)
if not config_file.exists():
return DataManager(app_config_dir=config_dir)
with open(config_file, 'rb') as handle:
loaded = pickle.load(handle)
if not isinstance(loaded, DataManager):
raise RuntimeError('Not a DataManager')
if loaded.version != cls.__VERSION:
loaded.upgrade()
return loaded
except Exception: # pylint: disable=broad-except
return DataManager(app_config_dir=config_dir)

@ntlhui ntlhui added the documentation Improvements or additions to documentation label Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant