Skip to content

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

@Zac-HD

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.

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