Visitar URL original
Feature request: lint for dropped exception after `.add_note()` · Issue #474 · PyCQA/flake8-bugbear · GitHub
Skip to content

Feature request: lint for dropped exception after .add_note() #474

Closed

Description

@Zac-HD
try:
    something()
except Exception as e:
    e.add_note("some helpful context")

This code is easy to write, but it has a nasty problem: you've just suppressed the exception! I think there should be a lint warning which triggers if you .add_note() an exception which is not either followed by a raise or raise e, or included in a function call or rhs of an assignment expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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