Skip to content

Use of BaseException in cdnengine.py #19

@Pascal-0x90

Description

@Pascal-0x90

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions