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

CustomException Class for adding already existing entries #293

Open
ftjahn8 opened this issue Jan 1, 2022 · 0 comments
Open

CustomException Class for adding already existing entries #293

ftjahn8 opened this issue Jan 1, 2022 · 0 comments

Comments

@ftjahn8
Copy link

ftjahn8 commented Jan 1, 2022

Current Situation:
If an already existing entry is added again to the KeePass, it raises an Exception (no custom Subclass, the base Exception!).

Example Traceback / Code line for potential change

File "XXXXX\venv\lib\site-packages\pykeepass\pykeepass.py", line 613, in add_entry
    raise Exception(
Exception: An entry "XXXXX" already exists in "Group: "XXXXX""

Wanted Behaviour:
A custom Exception is thrown by the code at this point.

Reason:

  1. Prevent the need to catch bare Exceptions to identify other occuring exceptions during (this or other) actions.
  2. Good style (PyLint Warning: W0703: Catching too general exception Exception (broad-except) for try: except Exception:)

Best Regards, ftjahn8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant