Skip to content

Fix S6667 FP: Don't flag expected exceptions like OperationCanceledException #9798

@Roald87

Description

@Roald87

Description

Not all exceptions in C# are proof of exceptional circumstances. For example, the OperationCanceledException is often an expected exception and therefore it should not be flagged as one that should be logged.

Maybe there should be a way to configure this rule on an exception level for example:

S6667 = warning
S6667.OperationCanceledException = none

Reproducer

Product and Version

SonarQube Server Data Center Edition v2025.5 (113872)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions