Skip to content

avoid_catches_without_on_clauses false positives #58545

@Hixie

Description

@Hixie

One valid use for catching all exceptions and errors is to forward them to some error reporting logic, for example, the way that Flutter frequently catches all exceptions and forwards them to FlutterError.reportError.

It would be nice if a function like FlutterError.reportError could be annotated as a valid reason to catch exceptions, such that if the catch block contains a call to such a function, it isn't flagged with avoid_catches_without_on_clauses.

Metadata

Metadata

Assignees

Labels

P3A lower priority bug or feature requestdevexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.linter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions