-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Issue #58545 (dealing with avoid_catches_without_on_clauses) was also linked as a blocker for enabling the avoid_catching_errors lint in Flutter and when enabling it I am essentially running into the same classes of problems:
- It flags when
Errors are caught that are laterrethrown after resetting some state. - It flags when
Errors are caught to then throw a newErrorwith a more specific error message. - It flags when
Errors are caught and directly passed to an error processing function (e.g.FlutterError.reportError)
I am wondering if the same lenience that was extended to avoid_catches_without_on_clauses in 500a8c0 in response to #58545 should also be applied to avoid_catching_errors?
FWIW, most of the uncovered reports of avoid_catching_errors are inside asserts to improve the debugging experience when those Errors happen during development. I wonder if catches in asserts should generally be exempt from the avoid_catching_errors lint or whether just those specific categories mentioned above should be exempt from the lint.
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug