Skip to content

[Tool Robustness] Map premature Analysis Server subprocess exits to ToolExit instead of crashing the tool #186962

@bkonyi

Description

@bkonyi

Description

When running flutter analyze, if the underlying dart language-server subprocess exits prematurely (e.g., due to an internal analyzer bug, circular dependency cycles, or memory limits), the command runner crashes with _Exception-c8e8a6fa rather than exiting gracefully.

This is because analyze_once.dart throws a generic Exception which bubbles up to the global zoned error handler, triggering a tool crash report.

Steps to Reproduce

  1. Force a crash or early exit in the Dart language-server process (e.g., by sending a kill signal or triggering a known Dart VM/analyzer crash during flutter analyze).
  2. Observe that the Flutter tool crashes with a crash report prompt rather than exiting gracefully.

Expected Behavior

The tool should print:
Error: analysis server exited with code <exitCode> and output: <logs>
and exit cleanly with a non-zero code, without displaying the "Oops; flutter has exited unexpectedly" dialog or uploading a crash report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-toolOwned by Flutter Tool team

    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