From 75fd9a349698dc131f5f3c21fd1cff68f0224467 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Sun, 17 May 2020 19:18:34 -0700 Subject: [PATCH] refactor: improve MoveItemToTrash error description (#23589) --- shell/common/platform_util_mac.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shell/common/platform_util_mac.mm b/shell/common/platform_util_mac.mm index 77d610da4f78..25e69c04bda9 100644 --- a/shell/common/platform_util_mac.mm +++ b/shell/common/platform_util_mac.mm @@ -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; }