Skip to content

flutter tool is too aggressive about catching exceptions #8742

@Hixie

Description

@Hixie

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_]+\) {.

cc @johnmccutchan

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions