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

Use of BaseException in cdnengine.py #19

Open
Pascal-0x90 opened this issue Aug 12, 2020 · 0 comments
Open

Use of BaseException in cdnengine.py #19

Pascal-0x90 opened this issue Aug 12, 2020 · 0 comments

Comments

@Pascal-0x90
Copy link
Collaborator

Pascal-0x90 commented Aug 12, 2020

Proposal

The use of BaseException should be changed to a set of specific exceptions which are thrown.

Motivation

The codebase should more strictly follow Python convention to hopefully improve maintainability.

Details

Due to the use of requests, some errors which are thrown from the cdn_check.py module, are not defined exceptions and are instead names of websites. This is something I have not been able to completely catch every exception that has occurred. We want to enforce the use of exceptions in this specific spot because, if an error gets thrown, the parent process may not exit and we will be left with a hung parent process. This is to assure the program at least kills the thread worker created even if we did not expect a specific exception.

except BaseException as err: # pylint: disable=broad-except

@Pascal-0x90 Pascal-0x90 mentioned this issue Aug 12, 2020
9 tasks
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