Bug 696186 - canceling folder delete throws an exception r=aceman
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sat, 30 Nov 2019 11:32:57 +1300
changeset 36753 c006cb1d5b5bdc9c88c05a3dfa9c22a059608c47
parent 36752 2328b40f1537207039d6f81c1847c40b653253d4
child 36754 c35cc8809feae83b247ca14d2d6f9e214dbbd476
push id2534
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:52:51 +0000
treeherdercomm-beta@055c50840778 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs696186
Bug 696186 - canceling folder delete throws an exception r=aceman
mail/base/content/folderPane.js
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -3074,17 +3074,25 @@ var gFolderTreeController = {
         ) != 0
       ) {
         /* the yes button is in position 0 */
         return;
       }
     }
 
     let array = toXPCOMArray([folder], Ci.nsIMutableArray);
-    folder.parent.deleteSubFolders(array, msgWindow);
+    try {
+      folder.parent.deleteSubFolders(array, msgWindow);
+    } catch (ex) {
+      // Ignore known errors from canceled warning dialogs.
+      const NS_MSG_ERROR_COPY_FOLDER_ABORTED = 0x8055001a;
+      if (ex.result != NS_MSG_ERROR_COPY_FOLDER_ABORTED) {
+        throw ex;
+      }
+    }
   },
 
   /**
    * Prompts the user to confirm and empties the trash for the selected folder.
    * The folder and its children are only emptied if it has the proper Trash flag.
    *
    * @param aFolder (optional)  The trash folder to empty. If unspecified or not
    *                            a trash folder, the currently selected server's