Beispiel #1
0
        protected HEMessageException(HEMessage message, Exception innerException, int extraStack, bool supressStack, bool startWithInnerException)
            : base(message.Message + (string.IsNullOrEmpty(message.Detail) ? "" : ": " + message.Detail), innerException)
        {
            StringBuilder sb = new StringBuilder(message.ExtraInfo);

            if (message.ExtraInfo != "")
            {
                sb.Append("\r\n");
            }

            if (!supressStack)
            {
                var cnt = 1;
                sb.Append("Exception Details:\r\n");
                if (!startWithInnerException)
                {
                    sb.Append("[1] {0}{1}\r\n{2}\r\n".F(message.Message, (string.IsNullOrEmpty(message.Detail) ? "" : ": " + message.Detail), getStackStraceExceptTop(2 + extraStack)));
                    cnt = 2;
                }

                if (innerException != null)
                {
                    Exception ex = innerException;
                    while (ex != null)
                    {
                        string stack = GetProperStackInfo(ex);
                        sb.Append("[{0}] {1}".F(cnt, stack));
                        ex = ex.InnerException;
                        cnt++;
                    }
                }
            }
            message.ExtraInfo = sb.ToString();
            @HEMessage        = message;
        }
Beispiel #2
0
        public HEMessageException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            // IMPORTANT - Java compatibility
            // The order by which the fields are being retrieved here must be
            // the same by which they are stored in the GetObjectData method

            @HEMessage = (@HEMessage)info.GetValue("HEMessage", typeof(HEMessage));
        }
Beispiel #3
0
 // Note the diff in ret type in Java...
 public int Add(HEMessage val)
 {
     if (isReadOnly)
     {
         throw new InvalidOperationException("Cannot add messages to the list because it is read-only");
     }
     else
     {
         return(base.Add(val));
     }
 }
Beispiel #4
0
        // For now we need this constructor from XML...
        public HEMessageArrayList(string xml) : base()
        {
            try {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xml);

                foreach (XmlElement elem in doc.SelectNodes("//Msg"))
                {
                    HEMessage msg = new HEMessage(elem);
                    this.Add(msg);
                }
            } catch (Exception ex) {
                throw new IOException("Error loading message list\r\nOriginal Xml : " + xml + "\r\nException : " + ex.ToString(), ex);
            }
        }
Beispiel #5
0
 public HENotImplementedException(HEMessage message) : base(message, null, 1, false)
 {
 }
Beispiel #6
0
 protected HEMessageException(HEMessage message, Exception innerException, int extraStack, bool supressStack)
     : this(message, innerException, extraStack, supressStack, /* startWithInnerException */ false)
 {
 }
Beispiel #7
0
 public HEMessageException(HEMessage message)
     : this(message, /* supressStack */ false)
 {
 }
Beispiel #8
0
 public HEMessageException(HEMessage message, bool supressStack)
     : this(message, /* innerException */ null, 1, supressStack)
 {
 }
Beispiel #9
0
 public HEMessageException(HEMessage message, Exception innerException, bool startWithInnerException)
     : this(message, innerException, 1, /* supressStack */ false, startWithInnerException)
 {
 }
Beispiel #10
0
 public HEMessageException(HEMessage message, Exception innerException)
     : this(message, innerException, 1, /* supressStack */ false)
 {
 }
Beispiel #11
0
 public HEMessageException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     @HEMessage = (@HEMessage)info.GetValue("HEMessage", typeof(HEMessage));
 }