Skip to content

Flutter clean should use noExitOnFailure when deleting #108978

Closed

Description

@zanderso

Currently when deleting, the EHFS will throwToolExit eagerly when deletion fails due to an access error. However the implementation of the clean command has its own logic for handling a failure to delete. This means users will likely never see the potentially helpful message here: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/clean.dart#L113.

Instead of deletion is called under EHFS.noExitOnFailure, the EHFS will throw an Exception instead of throwToolExit, which can then be caught by the clean command, which can still print its own message.

An alternative would be to take the advice from the clean command and add it to the advice in the EHFS when deletion fails due to an access error on Windows.

cc @christopherfujino

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    P2Important issues not at the top of the work list
    on Aug 4, 2022
  2. self-assigned this
    on May 23, 2025
  3. github-actions commented on Jun 18, 2025

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions