Skip to content

Commit

Permalink
refactor: improve MoveItemToTrash error description (#23628)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed May 19, 2020
1 parent 4da0164 commit 69a343e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions shell/common/platform_util_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,15 @@ bool MoveItemToTrash(const base::FilePath& full_path, bool delete_on_fail) {
// Handle this by deleting the item as a fallback.
if (!did_trash && [err code] == NSFeatureUnsupportedError) {
did_trash = [[NSFileManager defaultManager] removeItemAtURL:url
error:nil];
error:&err];
}
}

if (!did_trash)
if (!did_trash) {
LOG(WARNING) << "NSWorkspace failed to move file " << full_path.value()
<< " to trash";
<< " to trash: "
<< base::SysNSStringToUTF8([err localizedDescription]);
}

return did_trash;
}
Expand Down

0 comments on commit 69a343e

Please sign in to comment.