Bug 489505 - "Replace NS_ASSERTION(0, ...) by NS_ERROR(...) in comm-central" [r+sr=Standard8]
authorHashem Masoud <wraithlike@gmail.com>
Sat, 05 Sep 2009 00:16:04 +0100
changeset 3541 dde243bf059e4198a7799cf1717af76de3da007c
parent 3540 b11a45aa831d50594e7f23968bda9bc010103ef1
child 3542 f83b9d5dddd1333a7ec6b62ff8cd168bcb0b6f25
push idunknown
push userunknown
push dateunknown
bugs489505
Bug 489505 - "Replace NS_ASSERTION(0, ...) by NS_ERROR(...) in comm-central" [r+sr=Standard8]
mail/components/migration/src/nsDogbertProfileMigrator.cpp
mailnews/addrbook/src/nsAbManager.cpp
mailnews/base/search/src/nsMsgSearchValue.cpp
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/util/nsMsgI18N.cpp
mailnews/compose/src/nsMsgCompFields.cpp
mailnews/compose/src/nsMsgCompFields.h
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/db/msgdb/src/nsImapMailDatabase.cpp
mailnews/db/msgdb/src/nsMsgDatabase.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapService.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsRssService.cpp
mailnews/mime/src/mimecryp.cpp
mailnews/mime/src/mimeenc.cpp
mailnews/mime/src/mimeeobj.cpp
mailnews/mime/src/mimei.cpp
mailnews/mime/src/mimeiimg.cpp
mailnews/mime/src/mimeleaf.cpp
mailnews/mime/src/mimeobj.cpp
mailnews/mime/src/nsStreamConverter.cpp
mailnews/news/src/nsNNTPNewsgroupList.cpp
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNewsFolder.cpp
mailnews/news/src/nsNntpIncomingServer.cpp
mailnews/news/src/nsNntpService.cpp
--- a/mail/components/migration/src/nsDogbertProfileMigrator.cpp
+++ b/mail/components/migration/src/nsDogbertProfileMigrator.cpp
@@ -1002,17 +1002,17 @@ nsDogbertProfileMigrator::ProcessPrefsCa
     if (!exists)  {
       rv = newMOVEMAILMailPath->Create(nsIFile::DIRECTORY_TYPE, 0700);
       if (NS_FAILED(rv)) return rv;
     }
     rv = NS_OK;
   }
 #endif /* HAVE_MOVEMAIL */
   else {
-    NS_ASSERTION(0,"failure, didn't recognize your mail server type.\n");
+    NS_ERROR("failure, didn't recognize your mail server type.");
     return NS_ERROR_UNEXPECTED;
   }
 
   ////////////////////////////////////////////////////////////////////////////
   // Set all the appropriate NEWS prefs.
   ////////////////////////////////////////////////////////////////////////////
 
   rv = newNewsPath->Exists(&exists);
@@ -1129,17 +1129,17 @@ nsDogbertProfileMigrator::ProcessPrefsCa
     // we'll move and rename them
     rv = DoTheCopy(oldProfilePath, newProfilePath, POP_MAIL_FILTER_FILE_NAME_IN_4x);
     if (NS_FAILED(rv)) return rv;
 
     rv = DoTheCopy(oldMOVEMAILMailPath, newMOVEMAILMailPath, PR_TRUE);
   }
 #endif /* HAVE_MOVEMAIL */
   else {
-    NS_ASSERTION(0, "unknown mail server type!");
+    NS_ERROR("unknown mail server type!");
     return NS_ERROR_FAILURE;
   }
 
   // Don't inherit the 4.x cache file location for mozilla!
   // The cache pref later gets set with a default in nsAppRunner::InitCachePrefs().
   mPrefs->ClearUserPref(PREF_BROWSER_CACHE_DIRECTORY);
 
   rv = DoSpecialUpdates(newProfilePath);
--- a/mailnews/addrbook/src/nsAbManager.cpp
+++ b/mailnews/addrbook/src/nsAbManager.cpp
@@ -725,17 +725,17 @@ nsAbManager::ExportDirectoryToDelimitedT
                 newValue.AppendLiteral("\"");
               }
 
               rv = nsMsgI18NConvertFromUnicode(nsMsgI18NFileSystemCharset(),
                                                newValue, valueCStr);
               NS_ENSURE_SUCCESS(rv,rv);
 
               if (NS_FAILED(rv)) {
-                NS_ASSERTION(0, "failed to convert string to system charset.  use LDIF");
+                NS_ERROR("failed to convert string to system charset.  use LDIF");
                 valueCStr = "?";
               }
 
               length = valueCStr.Length();
               if (length) {
                 rv = outputStream->Write(valueCStr.get(), length, &writeCount);
                 NS_ENSURE_SUCCESS(rv,rv);
                 if (length != writeCount)
--- a/mailnews/base/search/src/nsMsgSearchValue.cpp
+++ b/mailnews/base/search/src/nsMsgSearchValue.cpp
@@ -133,15 +133,15 @@ nsMsgSearchValueImpl::ToString(nsAString
       nsAutoString tempInt;
       tempInt.AppendInt(mValue.attribute);
       
         aResult.AppendLiteral("type=");
         aResult.Append(tempInt);
     }
         break;
     default:
-        NS_ASSERTION(0, "Unknown search value type");
+        NS_ERROR("Unknown search value type");
     }        
 
     aResult.AppendLiteral("]");
 
     return NS_OK;
 }
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -3759,17 +3759,17 @@ nsresult nsMsgDBView::GetLongField(nsIMs
       {
         NS_ASSERTION(PR_FALSE, "should not be here (Sort Type: byCustom (Long), but no custom handler)");
         rv = NS_ERROR_UNEXPECTED;
       }
       break;
     case nsMsgViewSortType::byId:
         // handled by caller, since caller knows the key
     default:
-        NS_ASSERTION(0,"should not be here");
+        NS_ERROR("should not be here");
         rv = NS_ERROR_UNEXPECTED;
         break;
     }
 
     NS_ENSURE_SUCCESS(rv,rv);
     return NS_OK;
 }
 
@@ -4237,17 +4237,17 @@ NS_IMETHODIMP nsMsgDBView::Sort(nsMsgVie
     {
       case kCollationKey:
         NS_QuickSort(pPtrBase, numSoFar, sizeof(IdKey*), FnSortIdKey, &qsPrivateData);
         break;
       case kU32:
         NS_QuickSort(pPtrBase, numSoFar, sizeof(IdKey*), FnSortIdUint32, &qsPrivateData);
         break;
       default:
-        NS_ASSERTION(0, "not supposed to get here");
+        NS_ERROR("not supposed to get here");
         break;
     }
   }
 
   // now put the IDs into the array in proper order
   for (PRUint32 i = 0; i < numSoFar; i++)
   {
     m_keys[i] = pPtrBase[i]->id;
@@ -5767,17 +5767,17 @@ NS_IMETHODIMP nsMsgDBView::SetSortType(n
 {
     m_sortType = aSortType;
     return NS_OK;
 }
 
 
 NS_IMETHODIMP nsMsgDBView::GetViewType(nsMsgViewTypeValue *aViewType)
 {
-    NS_ASSERTION(0,"you should be overriding this\n");
+    NS_ERROR("you should be overriding this");
     return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP nsMsgDBView::GetSecondarySortOrder(nsMsgViewSortOrderValue *aSortOrder)
 {
     NS_ENSURE_ARG_POINTER(aSortOrder);
     *aSortOrder = m_secondarySortOrder;
     return NS_OK;
@@ -6178,17 +6178,17 @@ nsresult nsMsgDBView::NavigateFromPos(ns
             }
           }
           *pResultIndex = nsMsgViewIndex_None;
           *pResultKey = nsMsgKey_None;
           break;
 
         }
         default:
-            NS_ASSERTION(0, "unsupported motion");
+            NS_ERROR("unsupported motion");
             break;
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBView::NavigateStatus(nsMsgNavigationTypeValue motion, PRBool *_retval)
 {
     NS_ENSURE_ARG_POINTER(_retval);
@@ -6269,17 +6269,17 @@ NS_IMETHODIMP nsMsgDBView::NavigateStatu
             else
               desiredPos--; //? operator code didn't work for me
             enable = (desiredPos >= 0 && desiredPos < (PRInt32) historyCount / 2);
           }
         }
           break;
 
         default:
-            NS_ASSERTION(0,"unexpected");
+            NS_ERROR("unexpected");
             break;
     }
 
     *_retval = enable;
     return NS_OK;
 }
 
 // Note that these routines do NOT expand collapsed threads! This mimics the old behaviour,
@@ -6338,17 +6338,17 @@ nsresult nsMsgDBView::FindPrevUnread(nsM
         *resultThreadId = nsMsgKey_None;
 
     for (; (int) curIndex >= 0 && (*pResultKey == nsMsgKey_None); curIndex--)
     {
         PRUint32 flags = m_flags[curIndex];
 
         if (curIndex != startIndex && flags & MSG_VIEW_FLAG_ISTHREAD && flags & nsMsgMessageFlags::Elided)
         {
-            NS_ASSERTION(0,"fix this");
+            NS_ERROR("fix this");
             //nsMsgKey threadId = m_keys[curIndex];
             //rv = m_db->GetUnreadKeyInThread(threadId, pResultKey, resultThreadId);
             if (NS_SUCCEEDED(rv) && (*pResultKey != nsMsgKey_None))
                 break;
         }
         if (!(flags & (nsMsgMessageFlags::Read | MSG_VIEW_FLAG_DUMMY)) && (curIndex != startIndex))
         {
             *pResultKey = m_keys[curIndex];
--- a/mailnews/base/util/nsMsgI18N.cpp
+++ b/mailnews/base/util/nsMsgI18N.cpp
@@ -335,17 +335,17 @@ nsMsgI18NParseMetaCharset(nsILocalFile* 
 { 
   static char charset[nsIMimeConverter::MAX_CHARSET_NAME_LENGTH+1];
 
   *charset = '\0'; 
 
   PRBool isDirectory = PR_FALSE;
   file->IsDirectory(&isDirectory);
   if (isDirectory) {
-    NS_ASSERTION(0,"file is a directory");
+    NS_ERROR("file is a directory");
     return charset; 
   }
 
   nsresult rv;
   nsCOMPtr <nsIFileInputStream> fileStream = do_CreateInstance(NS_LOCALFILEINPUTSTREAM_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, charset);
   
   rv = fileStream->Init(file, PR_RDONLY, 0664, PR_FALSE);
--- a/mailnews/compose/src/nsMsgCompFields.cpp
+++ b/mailnews/compose/src/nsMsgCompFields.cpp
@@ -243,17 +243,17 @@ NS_IMETHODIMP nsMsgCompFields::SetSubjec
 
 NS_IMETHODIMP nsMsgCompFields::GetSubject(nsAString &_retval)
 {
   return GetUnicodeHeader(MSG_SUBJECT_HEADER_ID, _retval);
 }
 
 NS_IMETHODIMP nsMsgCompFields::SetTemporaryFiles(const char *value)
 {
-  NS_ASSERTION(0, "nsMsgCompFields::SetTemporaryFiles is not supported anymore, please use nsMsgCompFields::AddAttachment");
+  NS_ERROR("nsMsgCompFields::SetTemporaryFiles is not supported anymore, please use nsMsgCompFields::AddAttachment");
   return SetAsciiHeader(MSG_TEMPORARY_FILES_HEADER_ID, value);
 }
 
 NS_IMETHODIMP nsMsgCompFields::GetTemporaryFiles(char **_retval)
 {
   *_retval = strdup(GetAsciiHeader(MSG_TEMPORARY_FILES_HEADER_ID));
   return *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
--- a/mailnews/compose/src/nsMsgCompFields.h
+++ b/mailnews/compose/src/nsMsgCompFields.h
@@ -146,22 +146,22 @@ public:
 
   nsresult SetFollowupTo(const char *aValue) {return SetAsciiHeader(MSG_FOLLOWUP_TO_HEADER_ID, aValue);}
   const char* GetFollowupTo() {return GetAsciiHeader(MSG_FOLLOWUP_TO_HEADER_ID);}
 
   nsresult SetSubject(const char *value) {return SetAsciiHeader(MSG_SUBJECT_HEADER_ID, value);}
   const char* GetSubject() {return GetAsciiHeader(MSG_SUBJECT_HEADER_ID);}
 
   const char* GetAttachments() {
-    NS_ASSERTION(0, "nsMsgCompFields::GetAttachments is not supported anymore, please use nsMsgCompFields::GetAttachmentsArray");
+    NS_ERROR("nsMsgCompFields::GetAttachments is not supported anymore, please use nsMsgCompFields::GetAttachmentsArray");
     return GetAsciiHeader(MSG_ATTACHMENTS_HEADER_ID);
     }
 
   const char* GetTemporaryFiles() {
-    NS_ASSERTION(0, "nsMsgCompFields::GetTemporaryFiles is not supported anymore, please use nsMsgCompFields::GetAttachmentsArray");
+    NS_ERROR("nsMsgCompFields::GetTemporaryFiles is not supported anymore, please use nsMsgCompFields::GetAttachmentsArray");
     return GetAsciiHeader(MSG_TEMPORARY_FILES_HEADER_ID);
     }
 
   nsresult SetOrganization(const char *value) {return SetAsciiHeader(MSG_ORGANIZATION_HEADER_ID, value);}
   const char* GetOrganization() {return GetAsciiHeader(MSG_ORGANIZATION_HEADER_ID);}
 
   const char* GetReferences() {return GetAsciiHeader(MSG_REFERENCES_HEADER_ID);}
 
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -3832,17 +3832,17 @@ nsMsgCompose::LoadDataFromFile(nsILocalF
   PRInt32       readSize;
   PRUint32       nGot;
   char          *readBuf;
   char          *ptr;
 
   PRBool isDirectory = PR_FALSE;
   file->IsDirectory(&isDirectory);
   if (isDirectory) {
-    NS_ASSERTION(0,"file is a directory");
+    NS_ERROR("file is a directory");
     return NS_MSG_ERROR_READING_FILE;
   }
 
 
   nsCOMPtr <nsIInputStream> inputFile;
   nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inputFile), file);
   if (NS_FAILED(rv))
     return NS_MSG_ERROR_READING_FILE;
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -3657,17 +3657,17 @@ nsMsgComposeAndSend::DeliverFileAsMail()
     // "prefers" attribute in the ab.
     // see bug #245520 for more details
     // sendFormat = nsIAbPreferMailFormat::plaintext;
     sendFormat = nsIAbPreferMailFormat::unknown;
   }
   else if (!forcePlainText)
     sendFormat = nsIAbPreferMailFormat::html;
   else
-    NS_ASSERTION(0,"unknown send format, should not happen");
+    NS_ERROR("unknown send format, should not happen");
 #endif
 
   PL_strcpy (buf, "");
   buf2 = buf + PL_strlen (buf);
   if (mCompFields->GetTo() && *mCompFields->GetTo())
   {
     PL_strcat (buf2, mCompFields->GetTo());
     if (addressCollector)
--- a/mailnews/db/msgdb/src/nsImapMailDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsImapMailDatabase.cpp
@@ -131,17 +131,17 @@ NS_IMETHODIMP nsImapMailDatabase::ForceC
 
 NS_IMETHODIMP nsImapMailDatabase::GetFolderStream(nsIOutputStream **aFileStream)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsImapMailDatabase::SetFolderStream(nsIOutputStream *aFileStream)
 {
-  NS_ASSERTION(0, "Trying to set folderStream, not implemented");
+  NS_ERROR("Trying to set folderStream, not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult nsImapMailDatabase::GetAllPendingHdrsTable()
 {
   nsresult rv = NS_OK;
   if (!m_mdbAllPendingHdrsTable)
     rv = GetTableCreateIfMissing(kPendingHdrsScope, kPendingHdrsTableKind, getter_AddRefs(m_mdbAllPendingHdrsTable),
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -5343,17 +5343,17 @@ NS_IMETHODIMP nsMsgDatabase::ResetHdrCac
 
 NS_IMETHODIMP nsMsgDatabase::GetFolderStream(nsIOutputStream **aFileStream)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMsgDatabase::SetFolderStream(nsIOutputStream *aFileStream)
 {
-  NS_ASSERTION(0, "Trying to set the folderStream, not implemented");
+  NS_ERROR("Trying to set the folderStream, not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 /**
   void getNewList(out unsigned long count, [array, size_is(count)] out long newKeys);
  */
 NS_IMETHODIMP
 nsMsgDatabase::GetNewList(PRUint32 *aCount, PRUint32 **aNewKeys)
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -1758,17 +1758,17 @@ NS_IMETHODIMP nsImapMailFolder::RenameLo
       return dirFile->MoveToNative(nsnull, newNameStr);      // in case of rename operation leaf names will differ
 
     parentPathFile->AppendNative(newNameStr);    //only for move we need to progress further in case the parent differs
     PRBool isDirectory = PR_FALSE;
     parentPathFile->IsDirectory(&isDirectory);
     if (!isDirectory)
       parentPathFile->Create(nsIFile::DIRECTORY_TYPE, 0700);
     else
-      NS_ASSERTION(0,"Directory already exists.");
+      NS_ERROR("Directory already exists.");
     rv = RecursiveCopy(dirFile, parentPathFile);
     NS_ENSURE_SUCCESS(rv,rv);
     dirFile->Remove(PR_TRUE);                         // moving folders
   }
   return rv;
 }
 
 NS_IMETHODIMP nsImapMailFolder::GetPrettyName(nsAString& prettyName)
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -693,17 +693,17 @@ nsresult nsImapService::FetchMimePart(ns
         rv = aChannel->AsyncOpen(aStreamListener, aCtxt);
       }
       else // do what we used to do before
       {
         // I'd like to get rid of this code as I believe that we always get a docshell
         // or stream listener passed into us in this method but i'm not sure yet...
         // I'm going to use an assert for now to figure out if this is ever getting called
 #if defined(DEBUG_mscott) || defined(DEBUG_bienvenu)
-        NS_ASSERTION(0, "oops...someone still is reaching this part of the code");
+        NS_ERROR("oops...someone still is reaching this part of the code");
 #endif
         rv = GetImapConnectionAndLoadUrl(NS_GetCurrentThread(), aImapUrl,
                                          aDisplayConsumer, aURL);
       }
     }
   }
   return rv;
 }
@@ -1132,17 +1132,17 @@ nsresult nsImapService::GetMessageFromUr
       rv = channel->AsyncOpen(streamListener, aCtxt);
     }
     else // do what we used to do before
     {
       // I'd like to get rid of this code as I believe that we always get a docshell
       // or stream listener passed into us in this method but i'm not sure yet...
       // I'm going to use an assert for now to figure out if this is ever getting called
 #if defined(DEBUG_mscott) || defined(DEBUG_bienvenu)
-      NS_ASSERTION(0, "oops...someone still is reaching this part of the code");
+      NS_ERROR("oops...someone still is reaching this part of the code");
 #endif
       rv = GetImapConnectionAndLoadUrl(NS_GetCurrentThread(), aImapUrl,
                                        aDisplayConsumer, aURL);
     }
   }
   return rv;
 }
 
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -1653,17 +1653,17 @@ nsMsgLocalMailFolder::CopyMessages(nsIMs
                                    nsIMsgCopyServiceListener* listener,
                                    PRBool isFolder, PRBool allowUndo)
 {
   nsCOMPtr<nsISupports> srcSupport = do_QueryInterface(srcFolder);
   PRBool isServer;
   nsresult rv = GetIsServer(&isServer);
   if (NS_SUCCEEDED(rv) && isServer)
   {
-    NS_ASSERTION(0, "Destination is the root folder. Cannot move/copy here");
+    NS_ERROR("Destination is the root folder. Cannot move/copy here");
     if (isMove)
       srcFolder->NotifyFolderEvent(mDeleteOrMoveMsgFailedAtom);
     return OnCopyCompleted(srcSupport, PR_FALSE);
   }
 
   if (!(mFlags & (nsMsgFolderFlags::Trash|nsMsgFolderFlags::Junk)))
     SetMRUTime();
 
--- a/mailnews/local/src/nsRssService.cpp
+++ b/mailnews/local/src/nsRssService.cpp
@@ -73,35 +73,31 @@ NS_IMETHODIMP nsRssService::GetDefaultLo
    
     NS_IF_ADDREF(*aDefaultLocalPath = localFile);
     return NS_OK;
 
 }
 
 NS_IMETHODIMP nsRssService::SetDefaultLocalPath(nsILocalFile * aDefaultLocalPath)
 {
-    NS_ASSERTION(0,"foo");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsRssService::GetServerIID(nsIID * *aServerIID)
 {
-    NS_ASSERTION(0,"foo");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsRssService::GetRequiresUsername(PRBool *aRequiresUsername)
 {
-    NS_ASSERTION(0,"foo");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsRssService::GetPreflightPrettyNameWithEmailAddress(PRBool *aPreflightPrettyNameWithEmailAddress)
 {
-    NS_ASSERTION(0,"foo");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsRssService::GetCanDelete(PRBool *aCanDelete)
 {
     NS_ENSURE_ARG_POINTER(aCanDelete);
     *aCanDelete = PR_TRUE;
     return NS_OK;
@@ -153,11 +149,10 @@ NS_IMETHODIMP nsRssService::GetShowCompo
 {
     NS_ENSURE_ARG_POINTER(aShowComposeMsgLink);
     *aShowComposeMsgLink = PR_FALSE;    
     return NS_OK;
 }
 
 NS_IMETHODIMP nsRssService::GetSpecialFoldersDeletionAllowed(PRBool *aSpecialFoldersDeletionAllowed)
 {
-    NS_ASSERTION(0,"foo");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
--- a/mailnews/mime/src/mimecryp.cpp
+++ b/mailnews/mime/src/mimecryp.cpp
@@ -173,18 +173,17 @@ MimeEncrypted_parse_buffer (const char *
                                    size,
                                    obj);
 }
 
 
 static int
 MimeEncrypted_parse_line (const char *line, PRInt32 length, MimeObject *obj)
 {
-  NS_ASSERTION(0, "1.2 <mscott@netscape.com> 01 Nov 2001 17:59");
-  /* This method shouldn't ever be called. */
+  NS_ERROR("This method shouldn't ever be called.");
   return -1;
 }
 
 static int
 MimeEncrypted_parse_decoded_buffer (const char *buffer, PRInt32 size, MimeObject *obj)
 {
   MimeEncrypted *enc = (MimeEncrypted *) obj;
   return
--- a/mailnews/mime/src/mimeenc.cpp
+++ b/mailnews/mime/src/mimeenc.cpp
@@ -216,33 +216,35 @@ mime_decode_base64_token (const char *in
     unsigned char c = 0;
     if (in[j] >= 'A' && in[j] <= 'Z')     c = in[j] - 'A';
     else if (in[j] >= 'a' && in[j] <= 'z') c = in[j] - ('a' - 26);
     else if (in[j] >= '0' && in[j] <= '9') c = in[j] - ('0' - 52);
     else if (in[j] == '+')         c = 62;
     else if (in[j] == '/')         c = 63;
     else if (in[j] == '=')         c = 0, eq_count++;
     else
-    NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+    NS_ERROR("Invalid character");
     num = (num << 6) | c;
   }
 
   *out++ = (char) (num >> 16);
   *out++ = (char) ((num >> 8) & 0xFF);
   *out++ = (char) (num & 0xFF);
 
   if (eq_count == 0)
   return 3;        /* No "=" padding means 4 bytes mapped to 3. */
   else if (eq_count == 1)
   return 2;        /* "xxx=" means 3 bytes mapped to 2. */
   else if (eq_count == 2)
   return 1;        /* "xx==" means 2 bytes mapped to 1. */
   else
-  {            /* "x===" can't happen, because "x" would then */
-    NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");      /* be encoding only 6 bits, not the min of 8. */
+  {
+    // "x===" can't happen, because "x" would then be encoding only
+    // 6 bits, not the min of 8.
+    NS_ERROR("Count is 6 bits, should be at least 8");
     return 1;
   }
 }
 
 
 static int
 mime_decode_base64_buffer (MimeDecoderData *data,
                const char *buffer, PRInt32 length)
@@ -836,17 +838,17 @@ MimeDecoderWrite (MimeDecoderData *data,
     return mime_decode_base64_buffer (data, buffer, size);
   case mime_QuotedPrintable:
     return mime_decode_qp_buffer (data, buffer, size);
   case mime_uuencode:
     return mime_decode_uue_buffer (data, buffer, size);
   case mime_yencode:
     return mime_decode_yenc_buffer (data, buffer, size);
   default:
-    NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+    NS_ERROR("Invalid decoding");
     return -1;
   }
 }
 
 
 
 /* ================== Encoders.
  */
@@ -883,17 +885,17 @@ mime_encode_base64_buffer (MimeEncoderDa
   char *out = out_buffer;
   PRUint32 i = 0, n = 0;
   PRUint32 off;
 
   if (size == 0)
   return 0;
   else if (size < 0)
   {
-    NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+    NS_ERROR("Size is less than 0");
     return -1;
   }
 
 
   /* If this input buffer is too small, wait until next time. */
   if (size < (3 - data->in_buffer_count))
   {
     NS_ASSERTION(size < 3 && size > 0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
@@ -1221,12 +1223,12 @@ MimeEncoderWrite (MimeEncoderData *data,
   if (!data) return -1;
   switch(data->encoding)
   {
   case mime_Base64:
     return mime_encode_base64_buffer (data, buffer, size);
   case mime_QuotedPrintable:
     return mime_encode_qp_buffer (data, buffer, size);
   default:
-    NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+    NS_ERROR("Invalid encoding");
     return -1;
   }
 }
--- a/mailnews/mime/src/mimeeobj.cpp
+++ b/mailnews/mime/src/mimeeobj.cpp
@@ -245,30 +245,28 @@ MimeExternalObject_parse_decoded_buffer 
    because, unlike most children of MimeLeaf, we do not want to line-
    buffer the decoded data -- we want to simply pass it along to the
    backend, without going through our `parse_line' method.
    */
   if (!obj->output_p ||
     !obj->options ||
     obj->options->write_html_p)
   {
-    NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+    NS_ERROR("MimeObject is missing some data");
     return -1;
   }
 
   return MimeObject_write(obj, buf, size, PR_TRUE);
 }
 
 
 static int
 MimeExternalObject_parse_line (const char *line, PRInt32 length, MimeObject *obj)
 {
-  /* This method should never be called (externals do no line buffering).
-   */
-  NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+  NS_ERROR("This method should never be called (externals do no line buffering).");
   return -1;
 }
 
 static PRBool
 MimeExternalObject_displayable_inline_p (MimeObjectClass *clazz,
                      MimeHeaders *hdrs)
 {
   return PR_FALSE;
--- a/mailnews/mime/src/mimei.cpp
+++ b/mailnews/mime/src/mimei.cpp
@@ -1107,17 +1107,17 @@ mime_part_address(MimeObject *obj)
     for (i = 0; i < cont->nchildren; i++)
     if (cont->children[i] == obj)
       {
       j = i+1;
       break;
       }
     if (j == -1)
     {
-      NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+      NS_ERROR("No children under MeimContainer");
       return 0;
     }
 
     PR_snprintf(buf, sizeof(buf), "%ld", j);
     if (obj->parent->parent)
     {
       higher = mime_part_address(obj->parent);
       if (!higher) return 0;  /* MIME_OUT_OF_MEMORY */
--- a/mailnews/mime/src/mimeiimg.cpp
+++ b/mailnews/mime/src/mimeiimg.cpp
@@ -267,13 +267,11 @@ MimeInlineImage_parse_decoded_buffer (co
 
   return status;
 }
 
 
 static int
 MimeInlineImage_parse_line (const char *line, PRInt32 length, MimeObject *obj)
 {
-  /* This method should never be called (inline images do no line buffering).
-   */
-  NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
+  NS_ERROR("This method should never be called (inline images do no line buffering).");
   return -1;
 }
--- a/mailnews/mime/src/mimeleaf.cpp
+++ b/mailnews/mime/src/mimeleaf.cpp
@@ -175,18 +175,17 @@ MimeLeaf_parse_buffer (const char *buffe
   else
   return ((MimeLeafClass *)obj->clazz)->parse_decoded_buffer (buffer, size,
                                 obj);
 }
 
 static int
 MimeLeaf_parse_line (const char *line, PRInt32 length, MimeObject *obj)
 {
-  NS_ASSERTION(0, "1.1 <rhp@netscape.com> 19 Mar 1999 12:00");
-  /* This method shouldn't ever be called. */
+  NS_ERROR("MimeLeaf_parse_line shouldn't ever be called.");
   return -1;
 }
 
 
 static int
 MimeLeaf_close_decoder (MimeObject *obj)
 {
   MimeLeaf *leaf = (MimeLeaf *) obj;
--- a/mailnews/mime/src/mimeobj.cpp
+++ b/mailnews/mime/src/mimeobj.cpp
@@ -273,18 +273,17 @@ MimeObject_parse_buffer (const char *buf
               /* This cast is to turn void into MimeObject */
               obj->clazz->parse_line),
              obj);
 }
 
 static int
 MimeObject_parse_line (const char *line, PRInt32 length, MimeObject *obj)
 {
-  /* This method should never be called. */
-  NS_ASSERTION(0, "shouldn't call this method");
+  NS_ERROR("shouldn't call this method");
   return -1;
 }
 
 static int
 MimeObject_parse_eof (MimeObject *obj, PRBool abort_p)
 {
   if (obj->closed_p) return 0;
   NS_ASSERTION(!obj->parsed_p, "obj already parsed");
@@ -329,17 +328,17 @@ MimeObject_parse_end (MimeObject *obj, P
 
   obj->parsed_p = PR_TRUE;
   return 0;
 }
 
 static PRBool
 MimeObject_displayable_inline_p (MimeObjectClass *clazz, MimeHeaders *hdrs)
 {
-  NS_ASSERTION(0, "shouldn't call this method");  /* This method should never be called. */
+  NS_ERROR("shouldn't call this method");
   return PR_FALSE;
 }
 
 #if defined(DEBUG) && defined(XP_UNIX)
 static int
 MimeObject_debug_print (MimeObject *obj, PRFileDesc *stream, PRInt32 depth)
 {
   int i;
--- a/mailnews/mime/src/nsStreamConverter.cpp
+++ b/mailnews/mime/src/nsStreamConverter.cpp
@@ -613,17 +613,17 @@ NS_IMETHODIMP nsStreamConverter::Init(ns
       mOutputFormat = "text/html";
       break;
 
     case nsMimeOutput::nsMimeMessageFilterSniffer: // output all displayable part as raw
       mOutputFormat = "text/html";
       break;
 
     default:
-      NS_ASSERTION(0, "this means I made a mistake in my assumptions");
+      NS_ERROR("this means I made a mistake in my assumptions");
   }
 
 
   // the following output channel stream is used to fake the content type for people who later
   // call into us..
   nsCString contentTypeToUse;
   GetContentType(getter_Copies(contentTypeToUse));
   // mscott --> my theory is that we don't need this fake outgoing channel. Let's use the
--- a/mailnews/news/src/nsNNTPNewsgroupList.cpp
+++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp
@@ -758,17 +758,17 @@ NS_IMETHODIMP nsNNTPNewsgroupList::Apply
         messageArray->AppendElement(m_newMsgHdr, PR_FALSE);
 
         customAction->Apply(messageArray, value, nsnull,
                             nsMsgFilterType::NewsRule, aMsgWindow);
       }
       break;
 
       default:
-        NS_ASSERTION(0, "unexpected action");
+        NS_ERROR("unexpected action");
         break;
       }
 
       if (loggingEnabled)
         (void) aFilter->LogRuleHit(filterAction, m_newMsgHdr);
     }
   }
   return NS_OK;
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -1971,17 +1971,17 @@ PRInt32 nsNNTPProtocol::SendListSubscrip
     SetFlag(NNTP_PAUSE_FOR_READ);
     return 0;
   }
   if (!line)
     return status;  /* no line yet */
 
   if ('.' != line[0])
   {
-        NS_ASSERTION(0,"fix me");
+        NS_ERROR("fix me");
 #if 0
     char *url = PR_smprintf ("%s//%s/%s", NEWS_SCHEME, m_hostName, line);
     if (url)
       MSG_AddSubscribedNewsgroup (cd->pane, url);
 #endif
   }
   else
   {
@@ -2853,17 +2853,17 @@ PRInt32 nsNNTPProtocol::AuthorizationRes
   }
   else
   {
     /* login failed */
     HandleAuthenticationFailure();
     return(MK_NNTP_AUTH_FAILED);
   }
 
-  NS_ASSERTION(0,"should never get here");
+  NS_ERROR("should never get here");
   return(-1);
 
 }
 
 PRInt32 nsNNTPProtocol::PasswordResponse()
 {
   if (MK_NNTP_RESPONSE_AUTHINFO_OK == m_responseCode ||
     MK_NNTP_RESPONSE_AUTHINFO_SIMPLE_OK == m_responseCode)
@@ -2896,17 +2896,17 @@ PRInt32 nsNNTPProtocol::PasswordResponse
     return(0);
   }
   else
   {
     HandleAuthenticationFailure();
     return(MK_NNTP_AUTH_FAILED);
   }
 
-  NS_ASSERTION(0,"should never get here");
+  NS_ERROR("should never get here");
   return(-1);
 }
 
 PRInt32 nsNNTPProtocol::DisplayNewsgroups()
 {
   m_nextState = NEWS_DONE;
   ClearFlag(NNTP_PAUSE_FOR_READ);
 
@@ -4857,17 +4857,17 @@ PRInt32 nsNNTPProtocol::SendListGroupRes
   }
   PR_FREEIF(line);
   return 0;
 }
 
 
 PRInt32 nsNNTPProtocol::Search()
 {
-  NS_ASSERTION(0,"Search not implemented");
+  NS_ERROR("Search not implemented");
   return 0;
 }
 
 PRInt32 nsNNTPProtocol::SearchResponse()
 {
   if (MK_NNTP_RESPONSE_TYPE(m_responseCode) == MK_NNTP_RESPONSE_TYPE_OK)
     m_nextState = NNTP_SEARCH_RESULTS;
   else
@@ -4941,17 +4941,17 @@ PRInt32 nsNNTPProtocol::SetupForTransfer
     if (PL_strstr(ce->URL_s->address, "PROFILE NEW"))
       m_nextState = NNTP_PROFILE_ADD;
     else
       m_nextState = NNTP_PROFILE_DELETE;
   }
 #endif
   else
   {
-    NS_ASSERTION(0, "unexpected");
+    NS_ERROR("unexpected");
     return -1;
   }
 
   return(0); /* good */
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // The following method is used for processing the news state machine.
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -241,17 +241,16 @@ nsMsgNewsFolder::AddNewsgroup(const nsAC
   mSubFolders.AppendObject(folder);
   folder->SetParent(this);
   folder.swap(*child);
   return rv;
 }
 
 nsresult nsMsgNewsFolder::ParseFolder(nsILocalFile *path)
 {
-  NS_ASSERTION(0,"ParseFolder not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsMsgNewsFolder::AddDirectorySeparator(nsILocalFile *path)
 {
   // don't concat the full separator with .sbd
   return (mURI.Equals(kNewsRootURI)) ?
@@ -565,17 +564,16 @@ NS_IMETHODIMP nsMsgNewsFolder::Delete()
   rv = nntpServer->RemoveNewsgroup(name);
   NS_ENSURE_SUCCESS(rv,rv);
 
   return SetNewsrcHasChanged(PR_TRUE);
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::Rename(const nsAString& newName, nsIMsgWindow *msgWindow)
 {
-  NS_ASSERTION(0,"Rename not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::GetAbbreviatedName(nsAString& aAbbreviatedName)
 {
   nsresult rv;
 
   rv = nsMsgDBFolder::GetPrettyName(aAbbreviatedName);
@@ -756,29 +754,26 @@ NS_IMETHODIMP nsMsgNewsFolder::GetExpung
 {
   NS_ENSURE_ARG_POINTER(count);
   *count = mExpungedBytes;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::GetDeletable(PRBool *deletable)
 {
-  //  NS_ASSERTION(0,"GetDeletable() not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::GetRequiresCleanup(PRBool *requiresCleanup)
 {
-  //  NS_ASSERTION(0,"GetRequiresCleanup not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::GetSizeOnDisk(PRUint32 *size)
 {
-  //  NS_ASSERTION(0, "GetSizeOnDisk not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 /* this is news, so remember that DeleteMessage is really CANCEL. */
 NS_IMETHODIMP
 nsMsgNewsFolder::DeleteMessages(nsIArray *messages, nsIMsgWindow *aMsgWindow,
                                 PRBool deleteStorage, PRBool isMove,
                                 nsIMsgCopyServiceListener* listener, PRBool allowUndo)
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -1496,31 +1496,28 @@ nsNntpIncomingServer::ForgetPassword()
     }
 
     return return_rv;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetSupportsExtensions(PRBool *aSupportsExtensions)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetSupportsExtensions(PRBool aSupportsExtensions)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::AddExtension(const char *extension)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::QueryExtension(const char *extension, PRBool *result)
 {
 #ifdef DEBUG_seth
   printf("no extension support yet\n");
@@ -1548,59 +1545,52 @@ nsNntpIncomingServer::GetLastUpdatedTime
 {
   *aLastUpdatedTime = mLastUpdatedTime;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetLastUpdatedTime(PRUint32 aLastUpdatedTime)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::AddPropertyForGet(const char *name, const char *value)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::QueryPropertyForGet(const char *name, char **value)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::AddSearchableGroup(const nsAString &name)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::QuerySearchableGroup(const nsAString &name, PRBool *result)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::AddSearchableHeader(const char *name)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::QuerySearchableHeader(const char *name, PRBool *result)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::FindGroup(const nsACString &name, nsIMsgNewsFolder **result)
 {
   NS_ENSURE_ARG_POINTER(result);
 
@@ -1620,25 +1610,23 @@ nsNntpIncomingServer::FindGroup(const ns
   NS_ENSURE_SUCCESS(rv,rv);
   if (!*result) return NS_ERROR_FAILURE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetFirstGroupNeedingExtraInfo(nsACString &result)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetGroupNeedsExtraInfo(const nsACString &name,
                                              PRBool needsExtraInfo)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GroupNotFound(nsIMsgWindow *aMsgWindow,
                                     const nsAString &aName, PRBool aOpening)
 {
@@ -1689,17 +1677,16 @@ nsNntpIncomingServer::GroupNotFound(nsIM
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetPrettyNameForGroup(const nsAString &name,
                                             const nsAString &prettyName)
 {
-  NS_ASSERTION(0,"not implemented");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetCanSearchMessages(PRBool *canSearchMessages)
 {
     NS_ENSURE_ARG_POINTER(canSearchMessages);
     *canSearchMessages = PR_TRUE;
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -1297,17 +1297,17 @@ NS_IMETHODIMP nsNntpService::GetNewNews(
 
     rv = RunNewsUrl(aUrl, aMsgWindow, nsnull);
 
     if (_retval)
       NS_IF_ADDREF(*_retval = aUrl);
   }
   else
   {
-    NS_ASSERTION(0,"not a news:/ url");
+    NS_ERROR("not a news:/ url");
     rv = NS_ERROR_FAILURE;
   }
 
 
   NS_UNLOCK_INSTANCE();
   return rv;
 }