Update of /cvsroot/csmail/csmail/src/CSMail
In directory usw-pr-cvs1:/tmp/cvs-serv23484
Modified Files:
ChangeLog MessagingException.cs
Log Message:
2002-10-25
* MessagingException.cs : Meesage { get; },
: GetMessage() - Implemented.
: BaseMessage { get; } - Default is
an empty string, not null string.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- ChangeLog 25 Oct 2002 09:22:18 -0000 1.59
+++ ChangeLog 25 Oct 2002 10:07:34 -0000 1.60
@@ -1,6 +1,13 @@
2002-10-25 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+ * MessagingException.cs : Meesage { get; },
+ : GetMessage() - Implemented.
+ : BaseMessage { get; } - Default is
+ an empty string, not null string.
+
+2002-10-25 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+
* EMailAddress.cs : Validate() - Implemented.
: Unquote(string) - Implemented.
* EMailAddressList.cs : Contains() - Implemented.
Index: MessagingException.cs
===================================================================
RCS file: /cvsroot/csmail/csmail/src/CSMail/MessagingException.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MessagingException.cs 16 Sep 2002 11:22:47 -0000 1.4
+++ MessagingException.cs 25 Oct 2002 10:07:34 -0000 1.5
@@ -9,6 +9,7 @@
*/
using System;
+using System.Text;
namespace CSMail
{
@@ -37,12 +38,11 @@
}
}
- [MailTODO]
public override string Message
{
get
{
- throw new NotImplementedException();
+ return GetMessage();
}
}
@@ -50,8 +50,38 @@
{
get
{
- return base.Message;
+ if(base.Message != null)
+ return base.Message;
+ return String.Empty;
}
+ }
+
+ private string GetMessage()
+ {
+ if(next == null)
+ return BaseMessage;
+ Exception nextException = next;
+ StringBuilder retVal = new StringBuilder(BaseMessage);
+ while(nextException != null)
+ {
+ retVal.Append(";\n Nested Exception is:\n\t");
+ if(nextException is MessagingException)
+ {
+ MessagingException mex = (MessagingException)nextException;
+ retVal.Append(mex.GetType().ToString());
+ string bm = mex.BaseMessage;
+ if(bm.Length > 0)
+ {
+ retVal.Append(": " + bm);
+ }
+ nextException = mex.Next;
+ } else
+ {
+ retVal.Append(nextException.ToString());
+ nextException = null;
+ }
+ }
+ return retVal.ToString();
}
}
}
|