Bug 957495 - Add new error message if adding message header to database fails. ui-r=Josiah, r=irving
authoraceman <acelists@atlas.sk>
Sun, 11 May 2014 05:04:00 -0400
changeset 16197 66e6235a22012b38c6bc990892ce822a7331a437
parent 16196 b0b68d22439b9b17298bd599f9b7ce338c4d717f
child 16198 9f5b1f06702d545071e343d57ede6e72584c17dd
push id10127
push userryanvm@gmail.com
push dateThu, 15 May 2014 12:29:53 +0000
treeherdercomm-central@66e6235a2201 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJosiah, irving
bugs957495
Bug 957495 - Add new error message if adding message header to database fails. ui-r=Josiah, r=irving
mail/locales/en-US/chrome/messenger/messenger.properties
mailnews/local/src/nsParseMailbox.cpp
suite/locales/en-US/chrome/mailnews/messenger.properties
--- a/mail/locales/en-US/chrome/messenger/messenger.properties
+++ b/mail/locales/en-US/chrome/messenger/messenger.properties
@@ -76,16 +76,17 @@ confirmFolderDeletionForFilter=Deleting 
 alertFilterChanged=Filters associated with this folder will be updated.
 filterDisabled=The folder '%S' could not be found, so filter(s) associated with this folder will be disabled. Verify that the folder exists, and that filters point to a valid destination folder.
 filterFolderDeniedLocked=The messages could not be filtered to folder '%S' because another operation is in progress.
 parsingFolderFailed=Unable to open the folder %S because it is in use by some other operation. Please wait for that operation to finish and then select the folder again.
 deletingMsgsFailed=Unable to delete messages in folder %S because it is in use by some other operation. Please wait for that operation to finish and then try again.
 alertFilterCheckbox=Do not warn me again.
 compactFolderDeniedLock=The folder '%S' cannot be compacted because another operation is in progress. Please try again later.
 compactFolderWriteFailed=The folder '%S' could not be compacted because writing to folder failed. Verify that you have enough disk space, and that you have write privileges to the file system, then try again.
+filterFolderHdrAddFailed=The messages could not be filtered to folder '%S' because adding a message to it failed. Verify that the folder is displaying properly or try to repair it from the folder properties.
 filterFolderWriteFailed=The messages could not be filtered to folder '%S' because writing to folder failed. Verify that you have enough disk space, and that you have write privileges to the file system, then try again.
 copyMsgWriteFailed=The messages could not be moved or copied to folder '%S' because writing to folder failed. To gain disk space, from the File menu, first choose Empty Trash, and then choose Compact Folders, and then try again.
 cantMoveMsgWOBodyOffline=While working offline, you cannot move or copy messages that were not downloaded for offline use. From the Mail window, open the File menu, choose Offline, then uncheck Work Offline, and then try again.
 operationFailedFolderBusy=The operation failed because another operation is using the folder. Please wait for that operation to finish and then try again.
 folderRenameFailed=The folder could not be renamed. Perhaps the folder is being reparsed, or the new name is not a valid folder name.
 # LOCALIZATION NOTE(verboseFolderFormat): %1$S is folder name, %2$S is server name
 verboseFolderFormat=%1$S on %2$S
 # LOCALIZATION NOTE(filterFolderTruncateFailed): %1$S is replaced by the folder name, %2$S is replaced by the brandShortName
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -2503,32 +2503,33 @@ nsresult nsParseNewMailState::MoveIncorp
                    "failed to open mail db parsing folder");
   nsCOMPtr<nsIMsgDBHdr> newHdr;
 
   if (destMailDB)
     rv = destMailDB->CopyHdrFromExistingHdr(nsMsgKey_None, mailHdr, true,
                                             getter_AddRefs(newHdr));
   if (NS_SUCCEEDED(rv) && !newHdr)
     rv = NS_ERROR_UNEXPECTED;
-  if (NS_SUCCEEDED(rv))
+
+  if (NS_FAILED(rv))
   {
-    rv = AppendMsgFromStream(inputStream, newHdr, messageLength,
-                             destIFolder);
+    destIFolder->ThrowAlertMsg("filterFolderHdrAddFailed", msgWindow);
+  } else {
+    rv = AppendMsgFromStream(inputStream, newHdr, messageLength, destIFolder);
+    if (NS_FAILED(rv))
+      destIFolder->ThrowAlertMsg("filterFolderWriteFailed", msgWindow);
   }
 
   if (NS_FAILED(rv))
   {
     if (destMailDB)
       destMailDB->Close(true);
 
-    if (destIFolder)
-    {
-      destIFolder->ReleaseSemaphore(myISupports);
-      destIFolder->ThrowAlertMsg("filterFolderWriteFailed", msgWindow);
-    }
+    destIFolder->ReleaseSemaphore(myISupports);
+
     return NS_MSG_ERROR_WRITING_MAIL_FOLDER;
   }
 
   bool movedMsgIsNew = false;
   // if we have made it this far then the message has successfully been written to the new folder
   // now add the header to the destMailDB.
 
   uint32_t newFlags;
--- a/suite/locales/en-US/chrome/mailnews/messenger.properties
+++ b/suite/locales/en-US/chrome/mailnews/messenger.properties
@@ -68,21 +68,22 @@ autoCompactAllFoldersTitle=Compact Folde
 autoCompactAllFolders=Do you wish to compact all local and offline folders to save disk space?
 autoCompactAlwaysAskCheckbox=Always ask me before compacting folders automatically
 compactNowButton=Co&mpact Now
 
 confirmFolderDeletionForFilter=Deleting the folder '%S' will disable its associated filter(s). Are you sure you want to delete the folder?
 alertFilterChanged=Filters associated with this folder will be updated.
 filterDisabled=The folder '%S' could not be found, so filter(s) associated with this folder will be disabled. Verify that the folder exists, and that filters point to a valid destination folder.
 filterFolderDeniedLocked=The messages could not be filtered to folder '%S' because another operation is in progress.
-parsingFolderFailed=Unable to open the folder %S because it is in use by some other operation. Please wait for that operation to finish and then select the folder again. 
+parsingFolderFailed=Unable to open the folder %S because it is in use by some other operation. Please wait for that operation to finish and then select the folder again.
 deletingMsgsFailed=Unable to delete messages in folder %S because it is in use by some other operation. Please wait for that operation to finish and then try again.
 alertFilterCheckbox=Do not warn me again.
 compactFolderDeniedLock=The folder '%S' cannot be compacted because another operation is in progress. Please try again later.
 compactFolderWriteFailed=The folder '%S' could not be compacted because writing to folder failed. Verify that you have enough disk space, and that you have write privileges to the file system, then try again.
+filterFolderHdrAddFailed=The messages could not be filtered to folder '%S' because adding a message to it failed. Verify that the folder is displaying properly or try to repair it from the folder properties.
 filterFolderWriteFailed=The messages could not be filtered to folder '%S' because writing to folder failed. Verify that you have enough disk space, and that you have write privileges to the file system, then try again.
 copyMsgWriteFailed=The messages could not be moved or copied to folder '%S' because writing to folder failed. To gain disk space, from the File menu, first choose Empty Trash, and then choose Compact Folders, and then try again.
 cantMoveMsgWOBodyOffline=While working offline, you cannot move or copy messages that were not downloaded for offline use. From the Mail window, open the File menu, choose Offline, then uncheck Work Offline, and then try again.
 operationFailedFolderBusy=The operation failed because another operation is using the folder. Please wait for that operation to finish and then try again.
 folderRenameFailed=The folder could not be renamed. Perhaps the folder is being reparsed, or the new name is not a valid folder name.
 # LOCALIZATION NOTE(verboseFolderFormat): %1$S is folder name, %2$S is server name
 verboseFolderFormat=%1$S on %2$S
 # LOCALIZATION NOTE(filterFolderTruncateFailed): %1$S is replaced by the folder name, %2$S is replaced by the brandShortName