Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Cover trash failures for macOS and Windows with a message #1011

Merged
merged 2 commits into from
Jan 3, 2017

Conversation

lee-dohm
Copy link
Contributor

@lee-dohm lee-dohm commented Jan 2, 2017

Description of the Change

Deleting files from the Tree View can fail if the volume, drive or share doesn't support the platform's implementation of a "trash". Because this occurs much more frequently on Linux, we previously covered this with an enhanced error message in #695. This problem can still occur on Windows or macOS though and people on those platforms deserve a better error message to give them some idea of why Atom is unable to delete their files for them.

Alternate Designs

Considered returning more information from Electron's shell.moveItemToTrash function so that it could be detected if it was truly a trash problem or some other failure to delete the file. Adding support for better error conditions in a cross-platform way is beyond the scope of my time and abilities though, so this is what I opted for.

Benefits

  • People will get a less cryptic error message

Possible Drawbacks

  • The error message still may not point them in the right direction

Applicable Issues

switch process.platform
when 'linux' then 'Is `gvfs-trash` installed?'
when 'darwin' then 'Is Trash enabled on the volume where the files are stored?'
when 'win32' then 'Is RecycleBin support enabled on the drive where the files are stored?'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recycle Bin should be two words. An alternative wording could also be Is there a Recycle Bin on the drive where the files are stored?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

@lee-dohm lee-dohm merged commit b62a05a into master Jan 3, 2017
@lee-dohm lee-dohm deleted the better-error-message branch January 3, 2017 03:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants