You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flutter tool is too aggressive about catching exceptions #8742
There are a number of places in the flutter tool where we just catch any exception, print it, then move on, or return failure.
This is masking real errors, and results in confusing error messages. For example, it catches NoSuchMethodErrors and prints them to the user, instead of crashing and generating a crash log.
try .. catch blocks should only catch expected exceptions that can be handled, or that can be usefully reported before aborting cleanly.
We should remove all cases of blanket-catching exceptions, and all cases of catching exceptions and printing them but otherwise continuing unaffected.
You can easily find affected files by search for the regexp pattern } catch \([a-z_]+\) {.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Stop using package:stack_trace and Chain.capture (#8803)
zoechi commentedon Nov 28, 2018
Enabling the linter rule avoid_catches_without_on_clauses would enforce this
https://github.com/flutter/flutter/blob/master/analysis_options.yaml#L52
Levi-Lesches commentedon Oct 13, 2019
vkammerer commentedon Oct 14, 2019
Hixie commentedon Oct 14, 2019
radiKal07 commentedon Mar 3, 2020
What is
flutter tool, or what is the difference betweenflutterandflutter tool?Is this issue only a dev thing, or also happening in release?
zanderso commentedon Mar 6, 2020
In #52021, the tool has enabled the
avoid_catches_without_on_clauseslint.christopherfujino commentedon Mar 9, 2020
@Tudor07 this only affects devs. The "flutter tool" is the command line tool used in flutter development: https://github.com/flutter/flutter/tree/master/packages/flutter_tools
lock commentedon Apr 5, 2020
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.