Skip to content

Revise the disabling of broad-except pylint warning (W0703) #1332

Closed
@sechkova

Description

@sechkova

Description of issue or feature request:
An (anti)pattern starts to appear in the newer code (where stricter pylint checks are applied), a tendency to disable broad-except warnings.

Even though each case has its arguments, we should as a minimum make sure we log the exception and not silently bury it.

Current behavior:
# pylint: disable=broad-except throughout the code

Expected behavior:
At least log the exception before ignoring it:

try:
    do_something()
except Exception as e:
    logger.exception("An exception occurred")

Sync with #1178

Metadata

Metadata

Assignees

Labels

backlogIssues to address with priority for current development goalslow-prio

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions